imate
C++/CUDA Reference
py_c_matrix.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "NPY_NO_DEPRECATED_API",
9  "NPY_1_7_API_VERSION"
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "NPY_NO_DEPRECATED_API",
17  "NPY_1_7_API_VERSION"
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "NPY_NO_DEPRECATED_API",
25  "NPY_1_7_API_VERSION"
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "NPY_NO_DEPRECATED_API",
33  "NPY_1_7_API_VERSION"
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "NPY_NO_DEPRECATED_API",
41  "NPY_1_7_API_VERSION"
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "NPY_NO_DEPRECATED_API",
49  "NPY_1_7_API_VERSION"
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "NPY_NO_DEPRECATED_API",
57  "NPY_1_7_API_VERSION"
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "NPY_NO_DEPRECATED_API",
65  "NPY_1_7_API_VERSION"
66  ],
67  [
68  "CYTHON_EXTERN_C",
69  "extern \"C\""
70  ],
71  [
72  "NPY_NO_DEPRECATED_API",
73  "NPY_1_7_API_VERSION"
74  ],
75  [
76  "CYTHON_EXTERN_C",
77  "extern \"C\""
78  ],
79  [
80  "NPY_NO_DEPRECATED_API",
81  "NPY_1_7_API_VERSION"
82  ],
83  [
84  "CYTHON_EXTERN_C",
85  "extern \"C\""
86  ],
87  [
88  "NPY_NO_DEPRECATED_API",
89  "NPY_1_7_API_VERSION"
90  ],
91  [
92  "CYTHON_EXTERN_C",
93  "extern \"C\""
94  ],
95  [
96  "NPY_NO_DEPRECATED_API",
97  "NPY_1_7_API_VERSION"
98  ],
99  [
100  "CYTHON_EXTERN_C",
101  "extern \"C\""
102  ],
103  [
104  "NPY_NO_DEPRECATED_API",
105  "NPY_1_7_API_VERSION"
106  ],
107  [
108  "CYTHON_EXTERN_C",
109  "extern \"C\""
110  ],
111  [
112  "NPY_NO_DEPRECATED_API",
113  "NPY_1_7_API_VERSION"
114  ],
115  [
116  "CYTHON_EXTERN_C",
117  "extern \"C\""
118  ],
119  [
120  "NPY_NO_DEPRECATED_API",
121  "NPY_1_7_API_VERSION"
122  ],
123  [
124  "CYTHON_EXTERN_C",
125  "extern \"C\""
126  ]
127  ],
128  "depends": [
129  "imate/_c_linear_operator/c_csc_matrix.h",
130  "imate/_c_linear_operator/c_csr_matrix.h",
131  "imate/_c_linear_operator/c_dense_matrix.h",
132  "imate/_c_linear_operator/c_linear_operator.h",
133  "imate/_c_linear_operator/c_matrix.h"
134  ],
135  "include_dirs": [
136  "./imate/_c_linear_operator",
137  "i",
138  "m",
139  "a",
140  "t",
141  "e",
142  "/",
143  "_",
144  "c",
145  "b",
146  "s",
147  "l",
148  "g",
149  "r"
150  ],
151  "language": "c++",
152  "name": "imate._c_linear_operator.py_c_matrix",
153  "sources": [
154  "./imate/_c_linear_operator/py_c_matrix.pyx",
155  "./imate/_c_linear_operator/c_dense_matrix.cpp",
156  "./imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
157  "./imate/_c_linear_operator/c_affine_matrix_function.cpp",
158  "./imate/_c_linear_operator/c_matrix.cpp",
159  "./imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
160  "./imate/_c_linear_operator/c_linear_operator.cpp",
161  "./imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
162  "./imate/_c_linear_operator/c_csc_matrix.cpp",
163  "./imate/_c_linear_operator/c_csr_matrix.cpp",
164  "imate/_c_basic_algebra/c_vector_operations.cpp",
165  "imate/_c_basic_algebra/cblas_interface.cpp",
166  "imate/_c_basic_algebra/c_matrix_operations.cpp"
167  ]
168  },
169  "module_name": "imate._c_linear_operator.py_c_matrix"
170 }
171 END: Cython Metadata */
172 
173 #ifndef PY_SSIZE_T_CLEAN
174 #define PY_SSIZE_T_CLEAN
175 #endif /* PY_SSIZE_T_CLEAN */
176 #include "Python.h"
177 #ifndef Py_PYTHON_H
178  #error Python headers needed to compile C extensions, please install development version of Python.
179 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
180  #error Cython requires Python 2.6+ or Python 3.3+.
181 #else
182 #define CYTHON_ABI "0_29_36"
183 #define CYTHON_HEX_VERSION 0x001D24F0
184 #define CYTHON_FUTURE_DIVISION 1
185 #include <stddef.h>
186 #ifndef offsetof
187  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
188 #endif
189 #if !defined(WIN32) && !defined(MS_WINDOWS)
190  #ifndef __stdcall
191  #define __stdcall
192  #endif
193  #ifndef __cdecl
194  #define __cdecl
195  #endif
196  #ifndef __fastcall
197  #define __fastcall
198  #endif
199 #endif
200 #ifndef DL_IMPORT
201  #define DL_IMPORT(t) t
202 #endif
203 #ifndef DL_EXPORT
204  #define DL_EXPORT(t) t
205 #endif
206 #define __PYX_COMMA ,
207 #ifndef HAVE_LONG_LONG
208  #if PY_VERSION_HEX >= 0x02070000
209  #define HAVE_LONG_LONG
210  #endif
211 #endif
212 #ifndef PY_LONG_LONG
213  #define PY_LONG_LONG LONG_LONG
214 #endif
215 #ifndef Py_HUGE_VAL
216  #define Py_HUGE_VAL HUGE_VAL
217 #endif
218 #ifdef PYPY_VERSION
219  #define CYTHON_COMPILING_IN_PYPY 1
220  #define CYTHON_COMPILING_IN_PYSTON 0
221  #define CYTHON_COMPILING_IN_CPYTHON 0
222  #define CYTHON_COMPILING_IN_NOGIL 0
223  #undef CYTHON_USE_TYPE_SLOTS
224  #define CYTHON_USE_TYPE_SLOTS 0
225  #undef CYTHON_USE_PYTYPE_LOOKUP
226  #define CYTHON_USE_PYTYPE_LOOKUP 0
227  #if PY_VERSION_HEX < 0x03050000
228  #undef CYTHON_USE_ASYNC_SLOTS
229  #define CYTHON_USE_ASYNC_SLOTS 0
230  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
231  #define CYTHON_USE_ASYNC_SLOTS 1
232  #endif
233  #undef CYTHON_USE_PYLIST_INTERNALS
234  #define CYTHON_USE_PYLIST_INTERNALS 0
235  #undef CYTHON_USE_UNICODE_INTERNALS
236  #define CYTHON_USE_UNICODE_INTERNALS 0
237  #undef CYTHON_USE_UNICODE_WRITER
238  #define CYTHON_USE_UNICODE_WRITER 0
239  #undef CYTHON_USE_PYLONG_INTERNALS
240  #define CYTHON_USE_PYLONG_INTERNALS 0
241  #undef CYTHON_AVOID_BORROWED_REFS
242  #define CYTHON_AVOID_BORROWED_REFS 1
243  #undef CYTHON_ASSUME_SAFE_MACROS
244  #define CYTHON_ASSUME_SAFE_MACROS 0
245  #undef CYTHON_UNPACK_METHODS
246  #define CYTHON_UNPACK_METHODS 0
247  #undef CYTHON_FAST_THREAD_STATE
248  #define CYTHON_FAST_THREAD_STATE 0
249  #undef CYTHON_FAST_PYCALL
250  #define CYTHON_FAST_PYCALL 0
251  #if PY_VERSION_HEX < 0x03090000
252  #undef CYTHON_PEP489_MULTI_PHASE_INIT
253  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
254  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
255  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
256  #endif
257  #undef CYTHON_USE_TP_FINALIZE
258  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
259  #undef CYTHON_USE_DICT_VERSIONS
260  #define CYTHON_USE_DICT_VERSIONS 0
261  #undef CYTHON_USE_EXC_INFO_STACK
262  #define CYTHON_USE_EXC_INFO_STACK 0
263  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
264  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
265  #endif
266 #elif defined(PYSTON_VERSION)
267  #define CYTHON_COMPILING_IN_PYPY 0
268  #define CYTHON_COMPILING_IN_PYSTON 1
269  #define CYTHON_COMPILING_IN_CPYTHON 0
270  #define CYTHON_COMPILING_IN_NOGIL 0
271  #ifndef CYTHON_USE_TYPE_SLOTS
272  #define CYTHON_USE_TYPE_SLOTS 1
273  #endif
274  #undef CYTHON_USE_PYTYPE_LOOKUP
275  #define CYTHON_USE_PYTYPE_LOOKUP 0
276  #undef CYTHON_USE_ASYNC_SLOTS
277  #define CYTHON_USE_ASYNC_SLOTS 0
278  #undef CYTHON_USE_PYLIST_INTERNALS
279  #define CYTHON_USE_PYLIST_INTERNALS 0
280  #ifndef CYTHON_USE_UNICODE_INTERNALS
281  #define CYTHON_USE_UNICODE_INTERNALS 1
282  #endif
283  #undef CYTHON_USE_UNICODE_WRITER
284  #define CYTHON_USE_UNICODE_WRITER 0
285  #undef CYTHON_USE_PYLONG_INTERNALS
286  #define CYTHON_USE_PYLONG_INTERNALS 0
287  #ifndef CYTHON_AVOID_BORROWED_REFS
288  #define CYTHON_AVOID_BORROWED_REFS 0
289  #endif
290  #ifndef CYTHON_ASSUME_SAFE_MACROS
291  #define CYTHON_ASSUME_SAFE_MACROS 1
292  #endif
293  #ifndef CYTHON_UNPACK_METHODS
294  #define CYTHON_UNPACK_METHODS 1
295  #endif
296  #undef CYTHON_FAST_THREAD_STATE
297  #define CYTHON_FAST_THREAD_STATE 0
298  #undef CYTHON_FAST_PYCALL
299  #define CYTHON_FAST_PYCALL 0
300  #undef CYTHON_PEP489_MULTI_PHASE_INIT
301  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
302  #undef CYTHON_USE_TP_FINALIZE
303  #define CYTHON_USE_TP_FINALIZE 0
304  #undef CYTHON_USE_DICT_VERSIONS
305  #define CYTHON_USE_DICT_VERSIONS 0
306  #undef CYTHON_USE_EXC_INFO_STACK
307  #define CYTHON_USE_EXC_INFO_STACK 0
308  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
309  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
310  #endif
311 #elif defined(PY_NOGIL)
312  #define CYTHON_COMPILING_IN_PYPY 0
313  #define CYTHON_COMPILING_IN_PYSTON 0
314  #define CYTHON_COMPILING_IN_CPYTHON 0
315  #define CYTHON_COMPILING_IN_NOGIL 1
316  #ifndef CYTHON_USE_TYPE_SLOTS
317  #define CYTHON_USE_TYPE_SLOTS 1
318  #endif
319  #undef CYTHON_USE_PYTYPE_LOOKUP
320  #define CYTHON_USE_PYTYPE_LOOKUP 0
321  #ifndef CYTHON_USE_ASYNC_SLOTS
322  #define CYTHON_USE_ASYNC_SLOTS 1
323  #endif
324  #undef CYTHON_USE_PYLIST_INTERNALS
325  #define CYTHON_USE_PYLIST_INTERNALS 0
326  #ifndef CYTHON_USE_UNICODE_INTERNALS
327  #define CYTHON_USE_UNICODE_INTERNALS 1
328  #endif
329  #undef CYTHON_USE_UNICODE_WRITER
330  #define CYTHON_USE_UNICODE_WRITER 0
331  #undef CYTHON_USE_PYLONG_INTERNALS
332  #define CYTHON_USE_PYLONG_INTERNALS 0
333  #ifndef CYTHON_AVOID_BORROWED_REFS
334  #define CYTHON_AVOID_BORROWED_REFS 0
335  #endif
336  #ifndef CYTHON_ASSUME_SAFE_MACROS
337  #define CYTHON_ASSUME_SAFE_MACROS 1
338  #endif
339  #ifndef CYTHON_UNPACK_METHODS
340  #define CYTHON_UNPACK_METHODS 1
341  #endif
342  #undef CYTHON_FAST_THREAD_STATE
343  #define CYTHON_FAST_THREAD_STATE 0
344  #undef CYTHON_FAST_PYCALL
345  #define CYTHON_FAST_PYCALL 0
346  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
347  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
348  #endif
349  #ifndef CYTHON_USE_TP_FINALIZE
350  #define CYTHON_USE_TP_FINALIZE 1
351  #endif
352  #undef CYTHON_USE_DICT_VERSIONS
353  #define CYTHON_USE_DICT_VERSIONS 0
354  #undef CYTHON_USE_EXC_INFO_STACK
355  #define CYTHON_USE_EXC_INFO_STACK 0
356 #else
357  #define CYTHON_COMPILING_IN_PYPY 0
358  #define CYTHON_COMPILING_IN_PYSTON 0
359  #define CYTHON_COMPILING_IN_CPYTHON 1
360  #define CYTHON_COMPILING_IN_NOGIL 0
361  #ifndef CYTHON_USE_TYPE_SLOTS
362  #define CYTHON_USE_TYPE_SLOTS 1
363  #endif
364  #if PY_VERSION_HEX < 0x02070000
365  #undef CYTHON_USE_PYTYPE_LOOKUP
366  #define CYTHON_USE_PYTYPE_LOOKUP 0
367  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
368  #define CYTHON_USE_PYTYPE_LOOKUP 1
369  #endif
370  #if PY_MAJOR_VERSION < 3
371  #undef CYTHON_USE_ASYNC_SLOTS
372  #define CYTHON_USE_ASYNC_SLOTS 0
373  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
374  #define CYTHON_USE_ASYNC_SLOTS 1
375  #endif
376  #if PY_VERSION_HEX < 0x02070000
377  #undef CYTHON_USE_PYLONG_INTERNALS
378  #define CYTHON_USE_PYLONG_INTERNALS 0
379  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
380  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
381  #endif
382  #ifndef CYTHON_USE_PYLIST_INTERNALS
383  #define CYTHON_USE_PYLIST_INTERNALS 1
384  #endif
385  #ifndef CYTHON_USE_UNICODE_INTERNALS
386  #define CYTHON_USE_UNICODE_INTERNALS 1
387  #endif
388  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
389  #undef CYTHON_USE_UNICODE_WRITER
390  #define CYTHON_USE_UNICODE_WRITER 0
391  #elif !defined(CYTHON_USE_UNICODE_WRITER)
392  #define CYTHON_USE_UNICODE_WRITER 1
393  #endif
394  #ifndef CYTHON_AVOID_BORROWED_REFS
395  #define CYTHON_AVOID_BORROWED_REFS 0
396  #endif
397  #ifndef CYTHON_ASSUME_SAFE_MACROS
398  #define CYTHON_ASSUME_SAFE_MACROS 1
399  #endif
400  #ifndef CYTHON_UNPACK_METHODS
401  #define CYTHON_UNPACK_METHODS 1
402  #endif
403  #if PY_VERSION_HEX >= 0x030B00A4
404  #undef CYTHON_FAST_THREAD_STATE
405  #define CYTHON_FAST_THREAD_STATE 0
406  #elif !defined(CYTHON_FAST_THREAD_STATE)
407  #define CYTHON_FAST_THREAD_STATE 1
408  #endif
409  #ifndef CYTHON_FAST_PYCALL
410  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
411  #endif
412  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
413  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
414  #endif
415  #ifndef CYTHON_USE_TP_FINALIZE
416  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
417  #endif
418  #ifndef CYTHON_USE_DICT_VERSIONS
419  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
420  #endif
421  #if PY_VERSION_HEX >= 0x030B00A4
422  #undef CYTHON_USE_EXC_INFO_STACK
423  #define CYTHON_USE_EXC_INFO_STACK 0
424  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
425  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
426  #endif
427  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
428  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
429  #endif
430 #endif
431 #if !defined(CYTHON_FAST_PYCCALL)
432 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
433 #endif
434 #if CYTHON_USE_PYLONG_INTERNALS
435  #if PY_MAJOR_VERSION < 3
436  #include "longintrepr.h"
437  #endif
438  #undef SHIFT
439  #undef BASE
440  #undef MASK
441  #ifdef SIZEOF_VOID_P
442  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
443  #endif
444 #endif
445 #ifndef __has_attribute
446  #define __has_attribute(x) 0
447 #endif
448 #ifndef __has_cpp_attribute
449  #define __has_cpp_attribute(x) 0
450 #endif
451 #ifndef CYTHON_RESTRICT
452  #if defined(__GNUC__)
453  #define CYTHON_RESTRICT __restrict__
454  #elif defined(_MSC_VER) && _MSC_VER >= 1400
455  #define CYTHON_RESTRICT __restrict
456  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
457  #define CYTHON_RESTRICT restrict
458  #else
459  #define CYTHON_RESTRICT
460  #endif
461 #endif
462 #ifndef CYTHON_UNUSED
463 # if defined(__GNUC__)
464 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
465 # define CYTHON_UNUSED __attribute__ ((__unused__))
466 # else
467 # define CYTHON_UNUSED
468 # endif
469 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
470 # define CYTHON_UNUSED __attribute__ ((__unused__))
471 # else
472 # define CYTHON_UNUSED
473 # endif
474 #endif
475 #ifndef CYTHON_MAYBE_UNUSED_VAR
476 # if defined(__cplusplus)
477  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
478 # else
479 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
480 # endif
481 #endif
482 #ifndef CYTHON_NCP_UNUSED
483 # if CYTHON_COMPILING_IN_CPYTHON
484 # define CYTHON_NCP_UNUSED
485 # else
486 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
487 # endif
488 #endif
489 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
490 #ifdef _MSC_VER
491  #ifndef _MSC_STDINT_H_
492  #if _MSC_VER < 1300
493  typedef unsigned char uint8_t;
494  typedef unsigned int uint32_t;
495  #else
496  typedef unsigned __int8 uint8_t;
497  typedef unsigned __int32 uint32_t;
498  #endif
499  #endif
500 #else
501  #include <stdint.h>
502 #endif
503 #ifndef CYTHON_FALLTHROUGH
504  #if defined(__cplusplus) && __cplusplus >= 201103L
505  #if __has_cpp_attribute(fallthrough)
506  #define CYTHON_FALLTHROUGH [[fallthrough]]
507  #elif __has_cpp_attribute(clang::fallthrough)
508  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
509  #elif __has_cpp_attribute(gnu::fallthrough)
510  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
511  #endif
512  #endif
513  #ifndef CYTHON_FALLTHROUGH
514  #if __has_attribute(fallthrough)
515  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
516  #else
517  #define CYTHON_FALLTHROUGH
518  #endif
519  #endif
520  #if defined(__clang__ ) && defined(__apple_build_version__)
521  #if __apple_build_version__ < 7000000
522  #undef CYTHON_FALLTHROUGH
523  #define CYTHON_FALLTHROUGH
524  #endif
525  #endif
526 #endif
527 
528 #ifndef __cplusplus
529  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
530 #endif
531 #ifndef CYTHON_INLINE
532  #if defined(__clang__)
533  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
534  #else
535  #define CYTHON_INLINE inline
536  #endif
537 #endif
538 template<typename T>
539 void __Pyx_call_destructor(T& x) {
540  x.~T();
541 }
542 template<typename T>
543 class __Pyx_FakeReference {
544  public:
545  __Pyx_FakeReference() : ptr(NULL) { }
546  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
547  T *operator->() { return ptr; }
548  T *operator&() { return ptr; }
549  operator T&() { return *ptr; }
550  template<typename U> bool operator ==(U other) { return *ptr == other; }
551  template<typename U> bool operator !=(U other) { return *ptr != other; }
552  private:
553  T *ptr;
554 };
555 
556 #define __PYX_BUILD_PY_SSIZE_T "n"
557 #define CYTHON_FORMAT_SSIZE_T "z"
558 #if PY_MAJOR_VERSION < 3
559  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
560  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
561  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
562  #define __Pyx_DefaultClassType PyClass_Type
563 #else
564  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
565  #define __Pyx_DefaultClassType PyType_Type
566 #if PY_VERSION_HEX >= 0x030B00A1
567  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
568  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
569  PyObject *fv, PyObject *cell, PyObject* fn,
570  PyObject *name, int fline, PyObject *lnos) {
571  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
572  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
573  const char *fn_cstr=NULL;
574  const char *name_cstr=NULL;
575  PyCodeObject* co=NULL;
576  PyObject *type, *value, *traceback;
577  PyErr_Fetch(&type, &value, &traceback);
578  if (!(kwds=PyDict_New())) goto end;
579  if (!(argcount=PyLong_FromLong(a))) goto end;
580  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
581  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
582  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
583  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
584  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
585  if (!(nlocals=PyLong_FromLong(l))) goto end;
586  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
587  if (!(stacksize=PyLong_FromLong(s))) goto end;
588  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
589  if (!(flags=PyLong_FromLong(f))) goto end;
590  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
591  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
592  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
593  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
594  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
595  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
596  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
597  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
598  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
599  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
600  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
601  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
602  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
603  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
604  Py_XDECREF((PyObject*)co);
605  co = (PyCodeObject*)call_result;
606  call_result = NULL;
607  if (0) {
608  cleanup_code_too:
609  Py_XDECREF((PyObject*)co);
610  co = NULL;
611  }
612  end:
613  Py_XDECREF(kwds);
614  Py_XDECREF(argcount);
615  Py_XDECREF(posonlyargcount);
616  Py_XDECREF(kwonlyargcount);
617  Py_XDECREF(nlocals);
618  Py_XDECREF(stacksize);
619  Py_XDECREF(replace);
620  Py_XDECREF(call_result);
621  Py_XDECREF(empty);
622  if (type) {
623  PyErr_Restore(type, value, traceback);
624  }
625  return co;
626  }
627 #else
628  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
629  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
630 #endif
631  #define __Pyx_DefaultClassType PyType_Type
632 #endif
633 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
634  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
635 #else
636  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
637 #endif
638 #ifndef Py_TPFLAGS_CHECKTYPES
639  #define Py_TPFLAGS_CHECKTYPES 0
640 #endif
641 #ifndef Py_TPFLAGS_HAVE_INDEX
642  #define Py_TPFLAGS_HAVE_INDEX 0
643 #endif
644 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
645  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
646 #endif
647 #ifndef Py_TPFLAGS_HAVE_FINALIZE
648  #define Py_TPFLAGS_HAVE_FINALIZE 0
649 #endif
650 #ifndef METH_STACKLESS
651  #define METH_STACKLESS 0
652 #endif
653 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
654  #ifndef METH_FASTCALL
655  #define METH_FASTCALL 0x80
656  #endif
657  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
658  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
659  Py_ssize_t nargs, PyObject *kwnames);
660 #else
661  #define __Pyx_PyCFunctionFast _PyCFunctionFast
662  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
663 #endif
664 #if CYTHON_FAST_PYCCALL
665 #define __Pyx_PyFastCFunction_Check(func)\
666  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
667 #else
668 #define __Pyx_PyFastCFunction_Check(func) 0
669 #endif
670 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
671  #define PyObject_Malloc(s) PyMem_Malloc(s)
672  #define PyObject_Free(p) PyMem_Free(p)
673  #define PyObject_Realloc(p) PyMem_Realloc(p)
674 #endif
675 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
676  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
677  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
678  #define PyMem_RawFree(p) PyMem_Free(p)
679 #endif
680 #if CYTHON_COMPILING_IN_PYSTON
681  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
682  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
683 #else
684  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
685  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
686 #endif
687 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
688  #define __Pyx_PyThreadState_Current PyThreadState_GET()
689 #elif PY_VERSION_HEX >= 0x03060000
690  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
691 #elif PY_VERSION_HEX >= 0x03000000
692  #define __Pyx_PyThreadState_Current PyThreadState_GET()
693 #else
694  #define __Pyx_PyThreadState_Current _PyThreadState_Current
695 #endif
696 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
697 #include "pythread.h"
698 #define Py_tss_NEEDS_INIT 0
699 typedef int Py_tss_t;
700 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
701  *key = PyThread_create_key();
702  return 0;
703 }
704 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
705  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
706  *key = Py_tss_NEEDS_INIT;
707  return key;
708 }
709 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
710  PyObject_Free(key);
711 }
712 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
713  return *key != Py_tss_NEEDS_INIT;
714 }
715 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
716  PyThread_delete_key(*key);
717  *key = Py_tss_NEEDS_INIT;
718 }
719 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
720  return PyThread_set_key_value(*key, value);
721 }
722 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
723  return PyThread_get_key_value(*key);
724 }
725 #endif
726 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
727 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
728 #else
729 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
730 #endif
731 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
732  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
733  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
734 #else
735  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
736  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
737 #endif
738 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
739 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
740 #else
741 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
742 #endif
743 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
744  #define CYTHON_PEP393_ENABLED 1
745  #if PY_VERSION_HEX >= 0x030C0000
746  #define __Pyx_PyUnicode_READY(op) (0)
747  #else
748  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
749  0 : _PyUnicode_Ready((PyObject *)(op)))
750  #endif
751  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
752  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
753  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
754  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
755  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
756  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
757  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
758  #if PY_VERSION_HEX >= 0x030C0000
759  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
760  #else
761  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
762  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
763  #else
764  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
765  #endif
766  #endif
767 #else
768  #define CYTHON_PEP393_ENABLED 0
769  #define PyUnicode_1BYTE_KIND 1
770  #define PyUnicode_2BYTE_KIND 2
771  #define PyUnicode_4BYTE_KIND 4
772  #define __Pyx_PyUnicode_READY(op) (0)
773  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
774  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
775  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
776  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
777  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
778  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
779  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
780  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
781 #endif
782 #if CYTHON_COMPILING_IN_PYPY
783  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
784  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
785 #else
786  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
787  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
788  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
789 #endif
790 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
791  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
792 #endif
793 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
794  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
795 #endif
796 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
797  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
798 #endif
799 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
800 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
801 #if PY_MAJOR_VERSION >= 3
802  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
803 #else
804  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
805 #endif
806 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
807  #define PyObject_ASCII(o) PyObject_Repr(o)
808 #endif
809 #if PY_MAJOR_VERSION >= 3
810  #define PyBaseString_Type PyUnicode_Type
811  #define PyStringObject PyUnicodeObject
812  #define PyString_Type PyUnicode_Type
813  #define PyString_Check PyUnicode_Check
814  #define PyString_CheckExact PyUnicode_CheckExact
815 #ifndef PyObject_Unicode
816  #define PyObject_Unicode PyObject_Str
817 #endif
818 #endif
819 #if PY_MAJOR_VERSION >= 3
820  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
821  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
822 #else
823  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
824  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
825 #endif
826 #ifndef PySet_CheckExact
827  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
828 #endif
829 #if PY_VERSION_HEX >= 0x030900A4
830  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
831  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
832 #else
833  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
834  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
835 #endif
836 #if CYTHON_ASSUME_SAFE_MACROS
837  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
838 #else
839  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
840 #endif
841 #if PY_MAJOR_VERSION >= 3
842  #define PyIntObject PyLongObject
843  #define PyInt_Type PyLong_Type
844  #define PyInt_Check(op) PyLong_Check(op)
845  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
846  #define PyInt_FromString PyLong_FromString
847  #define PyInt_FromUnicode PyLong_FromUnicode
848  #define PyInt_FromLong PyLong_FromLong
849  #define PyInt_FromSize_t PyLong_FromSize_t
850  #define PyInt_FromSsize_t PyLong_FromSsize_t
851  #define PyInt_AsLong PyLong_AsLong
852  #define PyInt_AS_LONG PyLong_AS_LONG
853  #define PyInt_AsSsize_t PyLong_AsSsize_t
854  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
855  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
856  #define PyNumber_Int PyNumber_Long
857 #endif
858 #if PY_MAJOR_VERSION >= 3
859  #define PyBoolObject PyLongObject
860 #endif
861 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
862  #ifndef PyUnicode_InternFromString
863  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
864  #endif
865 #endif
866 #if PY_VERSION_HEX < 0x030200A4
867  typedef long Py_hash_t;
868  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
869  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
870 #else
871  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
872  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
873 #endif
874 #if PY_MAJOR_VERSION >= 3
875  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
876 #else
877  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
878 #endif
879 #if CYTHON_USE_ASYNC_SLOTS
880  #if PY_VERSION_HEX >= 0x030500B1
881  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
882  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
883  #else
884  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
885  #endif
886 #else
887  #define __Pyx_PyType_AsAsync(obj) NULL
888 #endif
889 #ifndef __Pyx_PyAsyncMethodsStruct
890  typedef struct {
891  unaryfunc am_await;
892  unaryfunc am_aiter;
893  unaryfunc am_anext;
894  } __Pyx_PyAsyncMethodsStruct;
895 #endif
896 
897 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
898  #if !defined(_USE_MATH_DEFINES)
899  #define _USE_MATH_DEFINES
900  #endif
901 #endif
902 #include <math.h>
903 #ifdef NAN
904 #define __PYX_NAN() ((float) NAN)
905 #else
906 static CYTHON_INLINE float __PYX_NAN() {
907  float value;
908  memset(&value, 0xFF, sizeof(value));
909  return value;
910 }
911 #endif
912 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
913 #define __Pyx_truncl trunc
914 #else
915 #define __Pyx_truncl truncl
916 #endif
917 
918 #define __PYX_MARK_ERR_POS(f_index, lineno) \
919  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
920 #define __PYX_ERR(f_index, lineno, Ln_error) \
921  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
922 
923 #ifndef __PYX_EXTERN_C
924  #ifdef __cplusplus
925  #define __PYX_EXTERN_C extern "C"
926  #else
927  #define __PYX_EXTERN_C extern
928  #endif
929 #endif
930 
931 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
932 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
933 /* Early includes */
934 #include "ios"
935 #include "new"
936 #include "stdexcept"
937 #include "typeinfo"
938 #include "c_linear_operator.h"
939 #include "c_matrix.h"
940 #include "c_dense_matrix.h"
941 #include "c_csr_matrix.h"
942 #include "c_csc_matrix.h"
943 #include "pythread.h"
944 #include <string.h>
945 #include <stdlib.h>
946 #include <stdio.h>
947 #include "pystate.h"
948 #ifdef _OPENMP
949 #include <omp.h>
950 #endif /* _OPENMP */
951 
952 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
953 #define CYTHON_WITHOUT_ASSERTIONS
954 #endif
955 
956 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
957  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
958 
959 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
960 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
961 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
962 #define __PYX_DEFAULT_STRING_ENCODING ""
963 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
964 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
965 #define __Pyx_uchar_cast(c) ((unsigned char)c)
966 #define __Pyx_long_cast(x) ((long)x)
967 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
968  (sizeof(type) < sizeof(Py_ssize_t)) ||\
969  (sizeof(type) > sizeof(Py_ssize_t) &&\
970  likely(v < (type)PY_SSIZE_T_MAX ||\
971  v == (type)PY_SSIZE_T_MAX) &&\
972  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
973  v == (type)PY_SSIZE_T_MIN))) ||\
974  (sizeof(type) == sizeof(Py_ssize_t) &&\
975  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
976  v == (type)PY_SSIZE_T_MAX))) )
977 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
978  return (size_t) i < (size_t) limit;
979 }
980 #if defined (__cplusplus) && __cplusplus >= 201103L
981  #include <cstdlib>
982  #define __Pyx_sst_abs(value) std::abs(value)
983 #elif SIZEOF_INT >= SIZEOF_SIZE_T
984  #define __Pyx_sst_abs(value) abs(value)
985 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
986  #define __Pyx_sst_abs(value) labs(value)
987 #elif defined (_MSC_VER)
988  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
989 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
990  #define __Pyx_sst_abs(value) llabs(value)
991 #elif defined (__GNUC__)
992  #define __Pyx_sst_abs(value) __builtin_llabs(value)
993 #else
994  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
995 #endif
996 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
997 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
998 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
999 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1000 #define __Pyx_PyBytes_FromString PyBytes_FromString
1001 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1002 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1003 #if PY_MAJOR_VERSION < 3
1004  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1005  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1006 #else
1007  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1008  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1009 #endif
1010 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1011 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1012 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1013 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1014 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1015 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1016 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1017 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1018 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1019 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1020 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1021 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1022 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1023 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1024 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1025 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1026 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
1027  const Py_UNICODE *u_end = u;
1028  while (*u_end++) ;
1029  return (size_t)(u_end - u - 1);
1030 }
1031 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1032 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1033 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1034 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1035 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1036 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1037 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1038 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1039 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1040 #define __Pyx_PySequence_Tuple(obj)\
1041  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1042 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1043 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1044 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1045 #if CYTHON_ASSUME_SAFE_MACROS
1046 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1047 #else
1048 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1049 #endif
1050 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1051 #if PY_MAJOR_VERSION >= 3
1052 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1053 #else
1054 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1055 #endif
1056 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1057 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1058 static int __Pyx_sys_getdefaultencoding_not_ascii;
1059 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1060  PyObject* sys;
1061  PyObject* default_encoding = NULL;
1062  PyObject* ascii_chars_u = NULL;
1063  PyObject* ascii_chars_b = NULL;
1064  const char* default_encoding_c;
1065  sys = PyImport_ImportModule("sys");
1066  if (!sys) goto bad;
1067  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1068  Py_DECREF(sys);
1069  if (!default_encoding) goto bad;
1070  default_encoding_c = PyBytes_AsString(default_encoding);
1071  if (!default_encoding_c) goto bad;
1072  if (strcmp(default_encoding_c, "ascii") == 0) {
1073  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1074  } else {
1075  char ascii_chars[128];
1076  int c;
1077  for (c = 0; c < 128; c++) {
1078  ascii_chars[c] = c;
1079  }
1080  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1081  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1082  if (!ascii_chars_u) goto bad;
1083  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1084  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1085  PyErr_Format(
1086  PyExc_ValueError,
1087  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1088  default_encoding_c);
1089  goto bad;
1090  }
1091  Py_DECREF(ascii_chars_u);
1092  Py_DECREF(ascii_chars_b);
1093  }
1094  Py_DECREF(default_encoding);
1095  return 0;
1096 bad:
1097  Py_XDECREF(default_encoding);
1098  Py_XDECREF(ascii_chars_u);
1099  Py_XDECREF(ascii_chars_b);
1100  return -1;
1101 }
1102 #endif
1103 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1104 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1105 #else
1106 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1107 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1108 static char* __PYX_DEFAULT_STRING_ENCODING;
1109 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1110  PyObject* sys;
1111  PyObject* default_encoding = NULL;
1112  char* default_encoding_c;
1113  sys = PyImport_ImportModule("sys");
1114  if (!sys) goto bad;
1115  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1116  Py_DECREF(sys);
1117  if (!default_encoding) goto bad;
1118  default_encoding_c = PyBytes_AsString(default_encoding);
1119  if (!default_encoding_c) goto bad;
1120  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1121  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1122  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1123  Py_DECREF(default_encoding);
1124  return 0;
1125 bad:
1126  Py_XDECREF(default_encoding);
1127  return -1;
1128 }
1129 #endif
1130 #endif
1131 
1132 
1133 /* Test for GCC > 2.95 */
1134 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1135  #define likely(x) __builtin_expect(!!(x), 1)
1136  #define unlikely(x) __builtin_expect(!!(x), 0)
1137 #else /* !__GNUC__ or GCC < 2.95 */
1138  #define likely(x) (x)
1139  #define unlikely(x) (x)
1140 #endif /* __GNUC__ */
1141 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1142 
1143 static PyObject *__pyx_m = NULL;
1144 static PyObject *__pyx_d;
1145 static PyObject *__pyx_b;
1146 static PyObject *__pyx_cython_runtime = NULL;
1147 static PyObject *__pyx_empty_tuple;
1148 static PyObject *__pyx_empty_bytes;
1149 static PyObject *__pyx_empty_unicode;
1150 static int __pyx_lineno;
1151 static int __pyx_clineno = 0;
1152 static const char * __pyx_cfilenm= __FILE__;
1153 static const char *__pyx_filename;
1154 
1155 
1156 static const char *__pyx_f[] = {
1157  "imate/_c_linear_operator/py_c_matrix.pyx",
1158  "stringsource",
1159 };
1160 /* MemviewSliceStruct.proto */
1161 struct __pyx_memoryview_obj;
1162 typedef struct {
1163  struct __pyx_memoryview_obj *memview;
1164  char *data;
1165  Py_ssize_t shape[8];
1166  Py_ssize_t strides[8];
1167  Py_ssize_t suboffsets[8];
1168 } __Pyx_memviewslice;
1169 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1170 
1171 /* Atomics.proto */
1172 #include <pythread.h>
1173 #ifndef CYTHON_ATOMICS
1174  #define CYTHON_ATOMICS 1
1175 #endif
1176 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1177 #define __pyx_atomic_int_type int
1178 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1179  (__GNUC_MINOR__ > 1 ||\
1180  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1181  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1182  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1183  #ifdef __PYX_DEBUG_ATOMICS
1184  #warning "Using GNU atomics"
1185  #endif
1186 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1187  #include <intrin.h>
1188  #undef __pyx_atomic_int_type
1189  #define __pyx_atomic_int_type long
1190  #pragma intrinsic (_InterlockedExchangeAdd)
1191  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1192  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1193  #ifdef __PYX_DEBUG_ATOMICS
1194  #pragma message ("Using MSVC atomics")
1195  #endif
1196 #else
1197  #undef CYTHON_ATOMICS
1198  #define CYTHON_ATOMICS 0
1199  #ifdef __PYX_DEBUG_ATOMICS
1200  #warning "Not using atomics"
1201  #endif
1202 #endif
1203 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1204 #if CYTHON_ATOMICS
1205  #define __pyx_add_acquisition_count(memview)\
1206  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1207  #define __pyx_sub_acquisition_count(memview)\
1208  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1209 #else
1210  #define __pyx_add_acquisition_count(memview)\
1211  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1212  #define __pyx_sub_acquisition_count(memview)\
1213  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1214 #endif
1215 
1216 /* ForceInitThreads.proto */
1217 #ifndef __PYX_FORCE_INIT_THREADS
1218  #define __PYX_FORCE_INIT_THREADS 0
1219 #endif
1220 
1221 /* NoFastGil.proto */
1222 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1223 #define __Pyx_PyGILState_Release PyGILState_Release
1224 #define __Pyx_FastGIL_Remember()
1225 #define __Pyx_FastGIL_Forget()
1226 #define __Pyx_FastGilFuncInit()
1227 
1228 /* BufferFormatStructs.proto */
1229 #define IS_UNSIGNED(type) (((type) -1) > 0)
1230 struct __Pyx_StructField_;
1231 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1232 typedef struct {
1233  const char* name;
1234  struct __Pyx_StructField_* fields;
1235  size_t size;
1236  size_t arraysize[8];
1237  int ndim;
1238  char typegroup;
1239  char is_unsigned;
1240  int flags;
1241 } __Pyx_TypeInfo;
1242 typedef struct __Pyx_StructField_ {
1243  __Pyx_TypeInfo* type;
1244  const char* name;
1245  size_t offset;
1246 } __Pyx_StructField;
1247 typedef struct {
1248  __Pyx_StructField* field;
1249  size_t parent_offset;
1250 } __Pyx_BufFmt_StackElem;
1251 typedef struct {
1252  __Pyx_StructField root;
1253  __Pyx_BufFmt_StackElem* head;
1254  size_t fmt_offset;
1255  size_t new_count, enc_count;
1256  size_t struct_alignment;
1257  int is_complex;
1258  char enc_type;
1259  char new_packmode;
1260  char enc_packmode;
1261  char is_valid_array;
1262 } __Pyx_BufFmt_Context;
1263 
1264 
1265 /* "_definitions/types.pxd":97
1266  * ctypedef unsigned int[:] MemoryViewLongIndexType
1267  * ELSE:
1268  * ctypedef int LongIndexType # <<<<<<<<<<<<<<
1269  * ctypedef const int ConstLongIndexType
1270  * ctypedef int[:] MemoryViewLongIndexType
1271  */
1272 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1273 
1274 /* "_definitions/types.pxd":98
1275  * ELSE:
1276  * ctypedef int LongIndexType
1277  * ctypedef const int ConstLongIndexType # <<<<<<<<<<<<<<
1278  * ctypedef int[:] MemoryViewLongIndexType
1279  *
1280  */
1281 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1282 
1283 /* "_definitions/types.pxd":102
1284  *
1285  * # Used for indices of small matrices, or small size iterators
1286  * ctypedef int IndexType # <<<<<<<<<<<<<<
1287  * ctypedef const int ConstIndexType
1288  * ctypedef int[:] MemoryViewIndexType
1289  */
1290 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1291 
1292 /* "_definitions/types.pxd":103
1293  * # Used for indices of small matrices, or small size iterators
1294  * ctypedef int IndexType
1295  * ctypedef const int ConstIndexType # <<<<<<<<<<<<<<
1296  * ctypedef int[:] MemoryViewIndexType
1297  *
1298  */
1299 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1300 
1301 /* "_definitions/types.pxd":107
1302  *
1303  * # Used for both flags and integers used as signals, including negative integers
1304  * ctypedef int FlagType # <<<<<<<<<<<<<<
1305  * ctypedef const int ConstFlagType
1306  * ctypedef int[:] MemoryViewFlagType
1307  */
1308 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1309 
1310 /* "_definitions/types.pxd":108
1311  * # Used for both flags and integers used as signals, including negative integers
1312  * ctypedef int FlagType
1313  * ctypedef const int ConstFlagType # <<<<<<<<<<<<<<
1314  * ctypedef int[:] MemoryViewFlagType
1315  *
1316  */
1317 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1318 
1319 /*--- Type declarations ---*/
1320 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1321 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1322 struct __pyx_array_obj;
1323 struct __pyx_MemviewEnum_obj;
1324 struct __pyx_memoryview_obj;
1325 struct __pyx_memoryviewslice_obj;
1326 
1327 /* "_definitions/types.pxd":99
1328  * ctypedef int LongIndexType
1329  * ctypedef const int ConstLongIndexType
1330  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1331  *
1332  * # Used for indices of small matrices, or small size iterators
1333  */
1334 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1335 
1336 /* "_definitions/types.pxd":104
1337  * ctypedef int IndexType
1338  * ctypedef const int ConstIndexType
1339  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1340  *
1341  * # Used for both flags and integers used as signals, including negative integers
1342  */
1343 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1344 
1345 /* "_definitions/types.pxd":109
1346  * ctypedef int FlagType
1347  * ctypedef const int ConstFlagType
1348  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1349  *
1350  *
1351  */
1352 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1353 
1354 /* "_definitions/types.pxd":116
1355  * # ==============
1356  *
1357  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1358  * const double x,
1359  * const double kernel_param) nogil
1360  */
1361 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1362 
1363 /* "py_c_linear_operator.pxd":23
1364  * # ===================
1365  *
1366  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1367  *
1368  * # Attributes
1369  */
1370 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1371  PyObject_HEAD
1372  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1373  cLinearOperator<float> *Aop_float;
1374  cLinearOperator<double> *Aop_double;
1375  cLinearOperator<long double> *Aop_long_double;
1376  char *data_type_name;
1377  char *long_index_type_name;
1378  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1379  PyObject *parameters;
1380 };
1381 
1382 
1383 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1384  * # =========
1385  *
1386  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1387  * cdef A_csr
1388  * cdef A_indices_copy
1389  */
1390 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1391  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1392  PyObject *A_csr;
1393  PyObject *A_indices_copy;
1394  PyObject *A_index_pointer_copy;
1395 };
1396 
1397 
1398 /* "View.MemoryView":106
1399  *
1400  * @cname("__pyx_array")
1401  * cdef class array: # <<<<<<<<<<<<<<
1402  *
1403  * cdef:
1404  */
1405 struct __pyx_array_obj {
1406  PyObject_HEAD
1407  struct __pyx_vtabstruct_array *__pyx_vtab;
1408  char *data;
1409  Py_ssize_t len;
1410  char *format;
1411  int ndim;
1412  Py_ssize_t *_shape;
1413  Py_ssize_t *_strides;
1414  Py_ssize_t itemsize;
1415  PyObject *mode;
1416  PyObject *_format;
1417  void (*callback_free_data)(void *);
1418  int free_data;
1419  int dtype_is_object;
1420 };
1421 
1422 
1423 /* "View.MemoryView":280
1424  *
1425  * @cname('__pyx_MemviewEnum')
1426  * cdef class Enum(object): # <<<<<<<<<<<<<<
1427  * cdef object name
1428  * def __init__(self, name):
1429  */
1430 struct __pyx_MemviewEnum_obj {
1431  PyObject_HEAD
1432  PyObject *name;
1433 };
1434 
1435 
1436 /* "View.MemoryView":331
1437  *
1438  * @cname('__pyx_memoryview')
1439  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1440  *
1441  * cdef object obj
1442  */
1443 struct __pyx_memoryview_obj {
1444  PyObject_HEAD
1445  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1446  PyObject *obj;
1447  PyObject *_size;
1448  PyObject *_array_interface;
1449  PyThread_type_lock lock;
1450  __pyx_atomic_int acquisition_count[2];
1451  __pyx_atomic_int *acquisition_count_aligned_p;
1452  Py_buffer view;
1453  int flags;
1454  int dtype_is_object;
1455  __Pyx_TypeInfo *typeinfo;
1456 };
1457 
1458 
1459 /* "View.MemoryView":967
1460  *
1461  * @cname('__pyx_memoryviewslice')
1462  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1463  * "Internal class for passing memoryview slices to Python"
1464  *
1465  */
1466 struct __pyx_memoryviewslice_obj {
1467  struct __pyx_memoryview_obj __pyx_base;
1468  __Pyx_memviewslice from_slice;
1469  PyObject *from_object;
1470  PyObject *(*to_object_func)(char *);
1471  int (*to_dtype_func)(char *, PyObject *);
1472 };
1473 
1474 
1475 
1476 /* "py_c_linear_operator.pxd":23
1477  * # ===================
1478  *
1479  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1480  *
1481  * # Attributes
1482  */
1483 
1484 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1485  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1486  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1487  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1488  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1489  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1490  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1491  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1492 };
1493 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1494 
1495 
1496 /* "imate/_c_linear_operator/py_c_matrix.pyx":33
1497  * # =========
1498  *
1499  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1500  * """
1501  * Defines a linear operator that is a constant matrix.
1502  */
1503 
1504 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1505  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1506 };
1507 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1508 
1509 
1510 /* "View.MemoryView":106
1511  *
1512  * @cname("__pyx_array")
1513  * cdef class array: # <<<<<<<<<<<<<<
1514  *
1515  * cdef:
1516  */
1517 
1518 struct __pyx_vtabstruct_array {
1519  PyObject *(*get_memview)(struct __pyx_array_obj *);
1520 };
1521 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1522 
1523 
1524 /* "View.MemoryView":331
1525  *
1526  * @cname('__pyx_memoryview')
1527  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1528  *
1529  * cdef object obj
1530  */
1531 
1532 struct __pyx_vtabstruct_memoryview {
1533  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1534  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1535  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1536  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1537  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1538  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1539  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1540 };
1541 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1542 
1543 
1544 /* "View.MemoryView":967
1545  *
1546  * @cname('__pyx_memoryviewslice')
1547  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1548  * "Internal class for passing memoryview slices to Python"
1549  *
1550  */
1551 
1552 struct __pyx_vtabstruct__memoryviewslice {
1553  struct __pyx_vtabstruct_memoryview __pyx_base;
1554 };
1555 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1556 
1557 /* --- Runtime support code (head) --- */
1558 /* Refnanny.proto */
1559 #ifndef CYTHON_REFNANNY
1560  #define CYTHON_REFNANNY 0
1561 #endif
1562 #if CYTHON_REFNANNY
1563  typedef struct {
1564  void (*INCREF)(void*, PyObject*, int);
1565  void (*DECREF)(void*, PyObject*, int);
1566  void (*GOTREF)(void*, PyObject*, int);
1567  void (*GIVEREF)(void*, PyObject*, int);
1568  void* (*SetupContext)(const char*, int, const char*);
1569  void (*FinishContext)(void**);
1570  } __Pyx_RefNannyAPIStruct;
1571  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1572  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1573  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1574 #ifdef WITH_THREAD
1575  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1576  if (acquire_gil) {\
1577  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1578  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1579  PyGILState_Release(__pyx_gilstate_save);\
1580  } else {\
1581  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1582  }
1583 #else
1584  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1585  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1586 #endif
1587  #define __Pyx_RefNannyFinishContext()\
1588  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1589  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1590  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1591  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1592  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1593  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1594  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1595  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1596  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1597 #else
1598  #define __Pyx_RefNannyDeclarations
1599  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1600  #define __Pyx_RefNannyFinishContext()
1601  #define __Pyx_INCREF(r) Py_INCREF(r)
1602  #define __Pyx_DECREF(r) Py_DECREF(r)
1603  #define __Pyx_GOTREF(r)
1604  #define __Pyx_GIVEREF(r)
1605  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1606  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1607  #define __Pyx_XGOTREF(r)
1608  #define __Pyx_XGIVEREF(r)
1609 #endif
1610 #define __Pyx_XDECREF_SET(r, v) do {\
1611  PyObject *tmp = (PyObject *) r;\
1612  r = v; __Pyx_XDECREF(tmp);\
1613  } while (0)
1614 #define __Pyx_DECREF_SET(r, v) do {\
1615  PyObject *tmp = (PyObject *) r;\
1616  r = v; __Pyx_DECREF(tmp);\
1617  } while (0)
1618 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1619 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1620 
1621 /* PyObjectGetAttrStr.proto */
1622 #if CYTHON_USE_TYPE_SLOTS
1623 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1624 #else
1625 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1626 #endif
1627 
1628 /* GetBuiltinName.proto */
1629 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1630 
1631 /* RaiseDoubleKeywords.proto */
1632 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1633 
1634 /* ParseKeywords.proto */
1635 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1636  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1637  const char* function_name);
1638 
1639 /* RaiseArgTupleInvalid.proto */
1640 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1641  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1642 
1643 /* PyThreadStateGet.proto */
1644 #if CYTHON_FAST_THREAD_STATE
1645 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1646 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1647 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1648 #else
1649 #define __Pyx_PyThreadState_declare
1650 #define __Pyx_PyThreadState_assign
1651 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1652 #endif
1653 
1654 /* PyErrFetchRestore.proto */
1655 #if CYTHON_FAST_THREAD_STATE
1656 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1657 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1658 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1659 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1660 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1661 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1662 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1663 #if CYTHON_COMPILING_IN_CPYTHON
1664 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1665 #else
1666 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1667 #endif
1668 #else
1669 #define __Pyx_PyErr_Clear() PyErr_Clear()
1670 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1671 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1672 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1673 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1674 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1675 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1676 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1677 #endif
1678 
1679 /* Profile.proto */
1680 #ifndef CYTHON_PROFILE
1681 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1682  #define CYTHON_PROFILE 0
1683 #else
1684  #define CYTHON_PROFILE 1
1685 #endif
1686 #endif
1687 #ifndef CYTHON_TRACE_NOGIL
1688  #define CYTHON_TRACE_NOGIL 0
1689 #else
1690  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1691  #define CYTHON_TRACE 1
1692  #endif
1693 #endif
1694 #ifndef CYTHON_TRACE
1695  #define CYTHON_TRACE 0
1696 #endif
1697 #if CYTHON_TRACE
1698  #undef CYTHON_PROFILE_REUSE_FRAME
1699 #endif
1700 #ifndef CYTHON_PROFILE_REUSE_FRAME
1701  #define CYTHON_PROFILE_REUSE_FRAME 0
1702 #endif
1703 #if CYTHON_PROFILE || CYTHON_TRACE
1704  #include "compile.h"
1705  #include "frameobject.h"
1706  #include "traceback.h"
1707 #if PY_VERSION_HEX >= 0x030b00a6
1708  #ifndef Py_BUILD_CORE
1709  #define Py_BUILD_CORE 1
1710  #endif
1711  #include "internal/pycore_frame.h"
1712 #endif
1713  #if CYTHON_PROFILE_REUSE_FRAME
1714  #define CYTHON_FRAME_MODIFIER static
1715  #define CYTHON_FRAME_DEL(frame)
1716  #else
1717  #define CYTHON_FRAME_MODIFIER
1718  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1719  #endif
1720  #define __Pyx_TraceDeclarations\
1721  static PyCodeObject *__pyx_frame_code = NULL;\
1722  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1723  int __Pyx_use_tracing = 0;
1724  #define __Pyx_TraceFrameInit(codeobj)\
1725  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1726 #if PY_VERSION_HEX >= 0x030b00a2
1727  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1728  (unlikely((tstate)->cframe->use_tracing) &&\
1729  (!(check_tracing) || !(tstate)->tracing) &&\
1730  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1731  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1732  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1733 #elif PY_VERSION_HEX >= 0x030a00b1
1734  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1735  (unlikely((tstate)->cframe->use_tracing) &&\
1736  (!(check_tracing) || !(tstate)->tracing) &&\
1737  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1738  #define __Pyx_EnterTracing(tstate)\
1739  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1740  #define __Pyx_LeaveTracing(tstate)\
1741  do {\
1742  tstate->tracing--;\
1743  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1744  || tstate->c_profilefunc != NULL);\
1745  } while (0)
1746 #else
1747  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1748  (unlikely((tstate)->use_tracing) &&\
1749  (!(check_tracing) || !(tstate)->tracing) &&\
1750  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1751  #define __Pyx_EnterTracing(tstate)\
1752  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1753  #define __Pyx_LeaveTracing(tstate)\
1754  do {\
1755  tstate->tracing--;\
1756  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1757  || tstate->c_profilefunc != NULL);\
1758  } while (0)
1759 #endif
1760  #ifdef WITH_THREAD
1761  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1762  if (nogil) {\
1763  if (CYTHON_TRACE_NOGIL) {\
1764  PyThreadState *tstate;\
1765  PyGILState_STATE state = PyGILState_Ensure();\
1766  tstate = __Pyx_PyThreadState_Current;\
1767  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1768  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1769  }\
1770  PyGILState_Release(state);\
1771  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1772  }\
1773  } else {\
1774  PyThreadState* tstate = PyThreadState_GET();\
1775  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1776  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1777  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1778  }\
1779  }
1780  #else
1781  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1782  { PyThreadState* tstate = PyThreadState_GET();\
1783  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1784  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1785  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1786  }\
1787  }
1788  #endif
1789  #define __Pyx_TraceException()\
1790  if (likely(!__Pyx_use_tracing)); else {\
1791  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1792  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1793  __Pyx_EnterTracing(tstate);\
1794  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1795  if (exc_info) {\
1796  if (CYTHON_TRACE && tstate->c_tracefunc)\
1797  tstate->c_tracefunc(\
1798  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1799  tstate->c_profilefunc(\
1800  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1801  Py_DECREF(exc_info);\
1802  }\
1803  __Pyx_LeaveTracing(tstate);\
1804  }\
1805  }
1806  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1807  PyObject *type, *value, *traceback;
1808  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1809  __Pyx_EnterTracing(tstate);
1810  if (CYTHON_TRACE && tstate->c_tracefunc)
1811  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1812  if (tstate->c_profilefunc)
1813  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1814  CYTHON_FRAME_DEL(frame);
1815  __Pyx_LeaveTracing(tstate);
1816  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1817  }
1818  #ifdef WITH_THREAD
1819  #define __Pyx_TraceReturn(result, nogil)\
1820  if (likely(!__Pyx_use_tracing)); else {\
1821  if (nogil) {\
1822  if (CYTHON_TRACE_NOGIL) {\
1823  PyThreadState *tstate;\
1824  PyGILState_STATE state = PyGILState_Ensure();\
1825  tstate = __Pyx_PyThreadState_Current;\
1826  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1827  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1828  }\
1829  PyGILState_Release(state);\
1830  }\
1831  } else {\
1832  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1833  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1834  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1835  }\
1836  }\
1837  }
1838  #else
1839  #define __Pyx_TraceReturn(result, nogil)\
1840  if (likely(!__Pyx_use_tracing)); else {\
1841  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1842  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1843  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1844  }\
1845  }
1846  #endif
1847  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1848  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1849 #else
1850  #define __Pyx_TraceDeclarations
1851  #define __Pyx_TraceFrameInit(codeobj)
1852  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1853  #define __Pyx_TraceException()
1854  #define __Pyx_TraceReturn(result, nogil)
1855 #endif
1856 #if CYTHON_TRACE
1857  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1858  int ret;
1859  PyObject *type, *value, *traceback;
1860  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1861  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1862  __Pyx_EnterTracing(tstate);
1863  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1864  __Pyx_LeaveTracing(tstate);
1865  if (likely(!ret)) {
1866  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1867  } else {
1868  Py_XDECREF(type);
1869  Py_XDECREF(value);
1870  Py_XDECREF(traceback);
1871  }
1872  return ret;
1873  }
1874  #ifdef WITH_THREAD
1875  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1876  if (likely(!__Pyx_use_tracing)); else {\
1877  if (nogil) {\
1878  if (CYTHON_TRACE_NOGIL) {\
1879  int ret = 0;\
1880  PyThreadState *tstate;\
1881  PyGILState_STATE state = PyGILState_Ensure();\
1882  tstate = __Pyx_PyThreadState_Current;\
1883  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1884  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1885  }\
1886  PyGILState_Release(state);\
1887  if (unlikely(ret)) goto_error;\
1888  }\
1889  } else {\
1890  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1891  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1892  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1893  if (unlikely(ret)) goto_error;\
1894  }\
1895  }\
1896  }
1897  #else
1898  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1899  if (likely(!__Pyx_use_tracing)); else {\
1900  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1901  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1902  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1903  if (unlikely(ret)) goto_error;\
1904  }\
1905  }
1906  #endif
1907 #else
1908  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1909 #endif
1910 
1911 /* PyObjectCall.proto */
1912 #if CYTHON_COMPILING_IN_CPYTHON
1913 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1914 #else
1915 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1916 #endif
1917 
1918 /* RaiseException.proto */
1919 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1920 
1921 /* PyIntCompare.proto */
1922 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1923 
1924 /* IncludeStringH.proto */
1925 #include <string.h>
1926 
1927 /* BytesEquals.proto */
1928 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1929 
1930 /* PyDictVersioning.proto */
1931 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1932 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1933 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1934 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1935  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1936  (cache_var) = (value);
1937 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1938  static PY_UINT64_T __pyx_dict_version = 0;\
1939  static PyObject *__pyx_dict_cached_value = NULL;\
1940  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1941  (VAR) = __pyx_dict_cached_value;\
1942  } else {\
1943  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1944  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1945  }\
1946 }
1947 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1948 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1949 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1950 #else
1951 #define __PYX_GET_DICT_VERSION(dict) (0)
1952 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1953 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1954 #endif
1955 
1956 /* GetModuleGlobalName.proto */
1957 #if CYTHON_USE_DICT_VERSIONS
1958 #define __Pyx_GetModuleGlobalName(var, name) do {\
1959  static PY_UINT64_T __pyx_dict_version = 0;\
1960  static PyObject *__pyx_dict_cached_value = NULL;\
1961  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1962  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1963  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1964 } while(0)
1965 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1966  PY_UINT64_T __pyx_dict_version;\
1967  PyObject *__pyx_dict_cached_value;\
1968  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1969 } while(0)
1970 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1971 #else
1972 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1973 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1974 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1975 #endif
1976 
1977 /* PyCFunctionFastCall.proto */
1978 #if CYTHON_FAST_PYCCALL
1979 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1980 #else
1981 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1982 #endif
1983 
1984 /* PyFunctionFastCall.proto */
1985 #if CYTHON_FAST_PYCALL
1986 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1987  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1988 #if 1 || PY_VERSION_HEX < 0x030600B1
1989 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1990 #else
1991 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1992 #endif
1993 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1994  (sizeof(char [1 - 2*!(cond)]) - 1)
1995 #ifndef Py_MEMBER_SIZE
1996 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1997 #endif
1998 #if CYTHON_FAST_PYCALL
1999  static size_t __pyx_pyframe_localsplus_offset = 0;
2000  #include "frameobject.h"
2001 #if PY_VERSION_HEX >= 0x030b00a6
2002  #ifndef Py_BUILD_CORE
2003  #define Py_BUILD_CORE 1
2004  #endif
2005  #include "internal/pycore_frame.h"
2006 #endif
2007  #define __Pxy_PyFrame_Initialize_Offsets()\
2008  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2009  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2010  #define __Pyx_PyFrame_GetLocalsplus(frame)\
2011  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2012 #endif // CYTHON_FAST_PYCALL
2013 #endif
2014 
2015 /* PyObjectCall2Args.proto */
2016 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2017 
2018 /* PyObjectCallMethO.proto */
2019 #if CYTHON_COMPILING_IN_CPYTHON
2020 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2021 #endif
2022 
2023 /* PyObjectCallOneArg.proto */
2024 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2025 
2026 /* PyObjectCallNoArg.proto */
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2029 #else
2030 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2031 #endif
2032 
2033 /* GetItemInt.proto */
2034 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2035  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2036  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2037  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2038  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2039 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2040  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2041  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2042  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2043 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2044  int wraparound, int boundscheck);
2045 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2046  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2047  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2048  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2049 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2050  int wraparound, int boundscheck);
2051 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2052 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2053  int is_list, int wraparound, int boundscheck);
2054 
2055 /* DictGetItem.proto */
2056 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2057 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2058 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2059  (likely(PyDict_CheckExact(obj)) ?\
2060  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2061 #else
2062 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2063 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2064 #endif
2065 
2066 /* MemviewSliceInit.proto */
2067 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2068 #define __Pyx_MEMVIEW_DIRECT 1
2069 #define __Pyx_MEMVIEW_PTR 2
2070 #define __Pyx_MEMVIEW_FULL 4
2071 #define __Pyx_MEMVIEW_CONTIG 8
2072 #define __Pyx_MEMVIEW_STRIDED 16
2073 #define __Pyx_MEMVIEW_FOLLOW 32
2074 #define __Pyx_IS_C_CONTIG 1
2075 #define __Pyx_IS_F_CONTIG 2
2076 static int __Pyx_init_memviewslice(
2077  struct __pyx_memoryview_obj *memview,
2078  int ndim,
2079  __Pyx_memviewslice *memviewslice,
2080  int memview_is_new_reference);
2081 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2082  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2083 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2084  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2085 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2086 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2087 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2088 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2089 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2090 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2091 
2092 /* ArgTypeTest.proto */
2093 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2094  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2095  __Pyx__ArgTypeTest(obj, type, name, exact))
2096 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2097 
2098 /* UnicodeEquals.proto */
2099 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2100 
2101 /* StrEquals.proto */
2102 #if PY_MAJOR_VERSION >= 3
2103 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2104 #else
2105 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2106 #endif
2107 
2108 /* UnaryNegOverflows.proto */
2109 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2110  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2111 
2112 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2113 /* WriteUnraisableException.proto */
2114 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2115  int lineno, const char *filename,
2116  int full_traceback, int nogil);
2117 
2118 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2119 /* GetAttr.proto */
2120 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2121 
2122 /* ObjectGetItem.proto */
2123 #if CYTHON_USE_TYPE_SLOTS
2124 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2125 #else
2126 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2127 #endif
2128 
2129 /* decode_c_string_utf16.proto */
2130 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2131  int byteorder = 0;
2132  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2133 }
2134 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2135  int byteorder = -1;
2136  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2137 }
2138 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2139  int byteorder = 1;
2140  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2141 }
2142 
2143 /* decode_c_string.proto */
2144 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2145  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2146  const char* encoding, const char* errors,
2147  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2148 
2149 /* PyErrExceptionMatches.proto */
2150 #if CYTHON_FAST_THREAD_STATE
2151 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2152 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2153 #else
2154 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2155 #endif
2156 
2157 /* GetAttr3.proto */
2158 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2159 
2160 /* RaiseTooManyValuesToUnpack.proto */
2161 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2162 
2163 /* RaiseNeedMoreValuesToUnpack.proto */
2164 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2165 
2166 /* RaiseNoneIterError.proto */
2167 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2168 
2169 /* ExtTypeTest.proto */
2170 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2171 
2172 /* GetTopmostException.proto */
2173 #if CYTHON_USE_EXC_INFO_STACK
2174 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2175 #endif
2176 
2177 /* SaveResetException.proto */
2178 #if CYTHON_FAST_THREAD_STATE
2179 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2180 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2181 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2182 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2183 #else
2184 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2185 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2186 #endif
2187 
2188 /* GetException.proto */
2189 #if CYTHON_FAST_THREAD_STATE
2190 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2191 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2192 #else
2193 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2194 #endif
2195 
2196 /* SwapException.proto */
2197 #if CYTHON_FAST_THREAD_STATE
2198 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2199 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2200 #else
2201 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2202 #endif
2203 
2204 /* Import.proto */
2205 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2206 
2207 /* FastTypeChecks.proto */
2208 #if CYTHON_COMPILING_IN_CPYTHON
2209 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2210 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2211 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2212 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2213 #else
2214 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2215 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2216 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2217 #endif
2218 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2219 
2220 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2221 /* ListCompAppend.proto */
2222 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2223 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2224  PyListObject* L = (PyListObject*) list;
2225  Py_ssize_t len = Py_SIZE(list);
2226  if (likely(L->allocated > len)) {
2227  Py_INCREF(x);
2228  PyList_SET_ITEM(list, len, x);
2229  __Pyx_SET_SIZE(list, len + 1);
2230  return 0;
2231  }
2232  return PyList_Append(list, x);
2233 }
2234 #else
2235 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2236 #endif
2237 
2238 /* PyIntBinop.proto */
2239 #if !CYTHON_COMPILING_IN_PYPY
2240 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2241 #else
2242 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2243  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2244 #endif
2245 
2246 /* ListExtend.proto */
2247 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2248 #if CYTHON_COMPILING_IN_CPYTHON
2249  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2250  if (unlikely(!none))
2251  return -1;
2252  Py_DECREF(none);
2253  return 0;
2254 #else
2255  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2256 #endif
2257 }
2258 
2259 /* ListAppend.proto */
2260 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2261 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2262  PyListObject* L = (PyListObject*) list;
2263  Py_ssize_t len = Py_SIZE(list);
2264  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2265  Py_INCREF(x);
2266  PyList_SET_ITEM(list, len, x);
2267  __Pyx_SET_SIZE(list, len + 1);
2268  return 0;
2269  }
2270  return PyList_Append(list, x);
2271 }
2272 #else
2273 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2274 #endif
2275 
2276 /* AssertionsEnabled.proto */
2277 #define __Pyx_init_assertions_enabled()
2278 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2279  #define __pyx_assertions_enabled() (1)
2280 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2281  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2282 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2283  static int __pyx_assertions_enabled_flag;
2284  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2285  #undef __Pyx_init_assertions_enabled
2286  static void __Pyx_init_assertions_enabled(void) {
2287  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2288  }
2289 #else
2290  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2291 #endif
2292 
2293 /* None.proto */
2294 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2295 
2296 /* PySequenceContains.proto */
2297 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2298  int result = PySequence_Contains(seq, item);
2299  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2300 }
2301 
2302 /* ImportFrom.proto */
2303 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2304 
2305 /* HasAttr.proto */
2306 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2307 
2308 /* CallNextTpDealloc.proto */
2309 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2310 
2311 /* CallNextTpTraverse.proto */
2312 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2313 
2314 /* CallNextTpClear.proto */
2315 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2316 
2317 /* PyObject_GenericGetAttrNoDict.proto */
2318 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2319 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2320 #else
2321 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2322 #endif
2323 
2324 /* PyObject_GenericGetAttr.proto */
2325 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2326 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2327 #else
2328 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2329 #endif
2330 
2331 /* TypeImport.proto */
2332 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2333 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2334 #if __STDC_VERSION__ >= 201112L
2335 #include <stdalign.h>
2336 #endif
2337 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2338 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2339 #else
2340 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2341 #endif
2342 enum __Pyx_ImportType_CheckSize_0_29_36 {
2343  __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2344  __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2345  __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2346 };
2347 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2348 #endif
2349 
2350 /* GetVTable.proto */
2351 static void* __Pyx_GetVtable(PyObject *dict);
2352 
2353 /* SetVTable.proto */
2354 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2355 
2356 /* PyObjectGetAttrStrNoError.proto */
2357 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2358 
2359 /* SetupReduce.proto */
2360 static int __Pyx_setup_reduce(PyObject* type_obj);
2361 
2362 /* FetchCommonType.proto */
2363 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2364 
2365 /* CythonFunctionShared.proto */
2366 #define __Pyx_CyFunction_USED 1
2367 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2368 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2369 #define __Pyx_CYFUNCTION_CCLASS 0x04
2370 #define __Pyx_CyFunction_GetClosure(f)\
2371  (((__pyx_CyFunctionObject *) (f))->func_closure)
2372 #define __Pyx_CyFunction_GetClassObj(f)\
2373  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2374 #define __Pyx_CyFunction_Defaults(type, f)\
2375  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2376 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2377  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2378 typedef struct {
2379  PyCFunctionObject func;
2380 #if PY_VERSION_HEX < 0x030500A0
2381  PyObject *func_weakreflist;
2382 #endif
2383  PyObject *func_dict;
2384  PyObject *func_name;
2385  PyObject *func_qualname;
2386  PyObject *func_doc;
2387  PyObject *func_globals;
2388  PyObject *func_code;
2389  PyObject *func_closure;
2390  PyObject *func_classobj;
2391  void *defaults;
2392  int defaults_pyobjects;
2393  size_t defaults_size; // used by FusedFunction for copying defaults
2394  int flags;
2395  PyObject *defaults_tuple;
2396  PyObject *defaults_kwdict;
2397  PyObject *(*defaults_getter)(PyObject *);
2398  PyObject *func_annotations;
2399 } __pyx_CyFunctionObject;
2400 static PyTypeObject *__pyx_CyFunctionType = 0;
2401 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2402 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2403  int flags, PyObject* qualname,
2404  PyObject *self,
2405  PyObject *module, PyObject *globals,
2406  PyObject* code);
2407 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2408  size_t size,
2409  int pyobjects);
2410 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2411  PyObject *tuple);
2412 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2413  PyObject *dict);
2414 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2415  PyObject *dict);
2416 static int __pyx_CyFunction_init(void);
2417 
2418 /* CythonFunction.proto */
2419 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2420  int flags, PyObject* qualname,
2421  PyObject *closure,
2422  PyObject *module, PyObject *globals,
2423  PyObject* code);
2424 
2425 /* CLineInTraceback.proto */
2426 #ifdef CYTHON_CLINE_IN_TRACEBACK
2427 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2428 #else
2429 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2430 #endif
2431 
2432 /* CodeObjectCache.proto */
2433 typedef struct {
2434  PyCodeObject* code_object;
2435  int code_line;
2436 } __Pyx_CodeObjectCacheEntry;
2437 struct __Pyx_CodeObjectCache {
2438  int count;
2439  int max_count;
2440  __Pyx_CodeObjectCacheEntry* entries;
2441 };
2442 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2443 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2444 static PyCodeObject *__pyx_find_code_object(int code_line);
2445 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2446 
2447 /* AddTraceback.proto */
2448 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2449  int py_line, const char *filename);
2450 
2451 #if PY_MAJOR_VERSION < 3
2452  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2453  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2454 #else
2455  #define __Pyx_GetBuffer PyObject_GetBuffer
2456  #define __Pyx_ReleaseBuffer PyBuffer_Release
2457 #endif
2458 
2459 
2460 /* BufferStructDeclare.proto */
2461 typedef struct {
2462  Py_ssize_t shape, strides, suboffsets;
2463 } __Pyx_Buf_DimInfo;
2464 typedef struct {
2465  size_t refcount;
2466  Py_buffer pybuffer;
2467 } __Pyx_Buffer;
2468 typedef struct {
2469  __Pyx_Buffer *rcbuffer;
2470  char *data;
2471  __Pyx_Buf_DimInfo diminfo[8];
2472 } __Pyx_LocalBuf_ND;
2473 
2474 /* MemviewSliceIsContig.proto */
2475 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2476 
2477 /* OverlappingSlices.proto */
2478 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2479  __Pyx_memviewslice *slice2,
2480  int ndim, size_t itemsize);
2481 
2482 /* Capsule.proto */
2483 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2484 
2485 /* GCCDiagnostics.proto */
2486 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2487 #define __Pyx_HAS_GCC_DIAGNOSTIC
2488 #endif
2489 
2490 /* IsLittleEndian.proto */
2491 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2492 
2493 /* BufferFormatCheck.proto */
2494 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2495 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2496  __Pyx_BufFmt_StackElem* stack,
2497  __Pyx_TypeInfo* type);
2498 
2499 /* TypeInfoCompare.proto */
2500 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2501 
2502 /* MemviewSliceValidateAndInit.proto */
2503 static int __Pyx_ValidateAndInit_memviewslice(
2504  int *axes_specs,
2505  int c_or_f_flag,
2506  int buf_flags,
2507  int ndim,
2508  __Pyx_TypeInfo *dtype,
2509  __Pyx_BufFmt_StackElem stack[],
2510  __Pyx_memviewslice *memviewslice,
2511  PyObject *original_obj);
2512 
2513 /* ObjectToMemviewSlice.proto */
2514 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2515 
2516 /* ObjectToMemviewSlice.proto */
2517 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2518 
2519 /* CppExceptionConversion.proto */
2520 #ifndef __Pyx_CppExn2PyErr
2521 #include <new>
2522 #include <typeinfo>
2523 #include <stdexcept>
2524 #include <ios>
2525 static void __Pyx_CppExn2PyErr() {
2526  try {
2527  if (PyErr_Occurred())
2528  ; // let the latest Python exn pass through and ignore the current one
2529  else
2530  throw;
2531  } catch (const std::bad_alloc& exn) {
2532  PyErr_SetString(PyExc_MemoryError, exn.what());
2533  } catch (const std::bad_cast& exn) {
2534  PyErr_SetString(PyExc_TypeError, exn.what());
2535  } catch (const std::bad_typeid& exn) {
2536  PyErr_SetString(PyExc_TypeError, exn.what());
2537  } catch (const std::domain_error& exn) {
2538  PyErr_SetString(PyExc_ValueError, exn.what());
2539  } catch (const std::invalid_argument& exn) {
2540  PyErr_SetString(PyExc_ValueError, exn.what());
2541  } catch (const std::ios_base::failure& exn) {
2542  PyErr_SetString(PyExc_IOError, exn.what());
2543  } catch (const std::out_of_range& exn) {
2544  PyErr_SetString(PyExc_IndexError, exn.what());
2545  } catch (const std::overflow_error& exn) {
2546  PyErr_SetString(PyExc_OverflowError, exn.what());
2547  } catch (const std::range_error& exn) {
2548  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2549  } catch (const std::underflow_error& exn) {
2550  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2551  } catch (const std::exception& exn) {
2552  PyErr_SetString(PyExc_RuntimeError, exn.what());
2553  }
2554  catch (...)
2555  {
2556  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2557  }
2558 }
2559 #endif
2560 
2561 /* ObjectToMemviewSlice.proto */
2562 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2563 
2564 /* ObjectToMemviewSlice.proto */
2565 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2566 
2567 /* ObjectToMemviewSlice.proto */
2568 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2569 
2570 /* ObjectToMemviewSlice.proto */
2571 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *, int writable_flag);
2572 
2573 /* ObjectToMemviewSlice.proto */
2574 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2575 
2576 /* ObjectToMemviewSlice.proto */
2577 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2578 
2579 /* ObjectToMemviewSlice.proto */
2580 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2581 
2582 /* ObjectToMemviewSlice.proto */
2583 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2584 
2585 /* MemviewSliceCopyTemplate.proto */
2586 static __Pyx_memviewslice
2587 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2588  const char *mode, int ndim,
2589  size_t sizeof_dtype, int contig_flag,
2590  int dtype_is_object);
2591 
2592 /* CIntToPy.proto */
2593 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2594 
2595 /* CIntFromPy.proto */
2596 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2597 
2598 /* CIntFromPy.proto */
2599 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2600 
2601 /* CIntToPy.proto */
2602 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2603 
2604 /* CIntFromPy.proto */
2605 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2606 
2607 /* CheckBinaryVersion.proto */
2608 static int __Pyx_check_binary_version(void);
2609 
2610 /* InitStrings.proto */
2611 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2612 
2613 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2614 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2615 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2616 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2617 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2618 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2619 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2620 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2621 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2622 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2623 
2624 /* Module declarations from 'imate._definitions.types' */
2625 
2626 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2627 
2628 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2629 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2630 
2631 /* Module declarations from 'imate._c_linear_operator.c_matrix' */
2632 
2633 /* Module declarations from 'imate._c_linear_operator.c_dense_matrix' */
2634 
2635 /* Module declarations from 'imate._c_linear_operator.c_csr_matrix' */
2636 
2637 /* Module declarations from 'imate._c_linear_operator.c_csc_matrix' */
2638 
2639 /* Module declarations from 'imate._c_linear_operator.py_c_matrix' */
2640 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2641 static PyTypeObject *__pyx_array_type = 0;
2642 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2643 static PyTypeObject *__pyx_memoryview_type = 0;
2644 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2645 static PyObject *generic = 0;
2646 static PyObject *strided = 0;
2647 static PyObject *indirect = 0;
2648 static PyObject *contiguous = 0;
2649 static PyObject *indirect_contiguous = 0;
2650 static int __pyx_memoryview_thread_locks_used;
2651 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2652 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2653 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2654 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2655 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2656 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2657 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2658 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2659 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2660 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2661 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2662 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2663 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2664 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2665 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2666 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2667 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2668 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2669 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2670 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2671 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2672 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2673 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2674 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2675 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2676 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2677 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2678 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2679 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2680 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2681 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2682 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2683 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2684 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2685 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2686 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2687 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2688 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2689 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2690 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2691 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2692 
2693 /* Implementation of 'imate._c_linear_operator.py_c_matrix' */
2694 static PyObject *__pyx_builtin_ValueError;
2695 static PyObject *__pyx_builtin_TypeError;
2696 static PyObject *__pyx_builtin_MemoryError;
2697 static PyObject *__pyx_builtin_enumerate;
2698 static PyObject *__pyx_builtin_range;
2699 static PyObject *__pyx_builtin_Ellipsis;
2700 static PyObject *__pyx_builtin_id;
2701 static PyObject *__pyx_builtin_IndexError;
2702 static const char __pyx_k_A[] = "A";
2703 static const char __pyx_k_O[] = "O";
2704 static const char __pyx_k_c[] = "c";
2705 static const char __pyx_k_id[] = "id";
2706 static const char __pyx_k_new[] = "__new__";
2707 static const char __pyx_k_obj[] = "obj";
2708 static const char __pyx_k_base[] = "base";
2709 static const char __pyx_k_copy[] = "copy";
2710 static const char __pyx_k_data[] = "data";
2711 static const char __pyx_k_dict[] = "__dict__";
2712 static const char __pyx_k_main[] = "__main__";
2713 static const char __pyx_k_mode[] = "mode";
2714 static const char __pyx_k_name[] = "name";
2715 static const char __pyx_k_ndim[] = "ndim";
2716 static const char __pyx_k_pack[] = "pack";
2717 static const char __pyx_k_self[] = "self";
2718 static const char __pyx_k_size[] = "size";
2719 static const char __pyx_k_step[] = "step";
2720 static const char __pyx_k_stop[] = "stop";
2721 static const char __pyx_k_test[] = "__test__";
2722 static const char __pyx_k_ASCII[] = "ASCII";
2723 static const char __pyx_k_class[] = "__class__";
2724 static const char __pyx_k_dtype[] = "dtype";
2725 static const char __pyx_k_error[] = "error";
2726 static const char __pyx_k_flags[] = "flags";
2727 static const char __pyx_k_numpy[] = "numpy";
2728 static const char __pyx_k_range[] = "range";
2729 static const char __pyx_k_shape[] = "shape";
2730 static const char __pyx_k_start[] = "start";
2731 static const char __pyx_k_astype[] = "astype";
2732 static const char __pyx_k_encode[] = "encode";
2733 static const char __pyx_k_format[] = "format";
2734 static const char __pyx_k_import[] = "__import__";
2735 static const char __pyx_k_indptr[] = "indptr";
2736 static const char __pyx_k_name_2[] = "__name__";
2737 static const char __pyx_k_pickle[] = "pickle";
2738 static const char __pyx_k_reduce[] = "__reduce__";
2739 static const char __pyx_k_struct[] = "struct";
2740 static const char __pyx_k_unpack[] = "unpack";
2741 static const char __pyx_k_update[] = "update";
2742 static const char __pyx_k_float32[] = "float32";
2743 static const char __pyx_k_float64[] = "float64";
2744 static const char __pyx_k_fortran[] = "fortran";
2745 static const char __pyx_k_indices[] = "indices";
2746 static const char __pyx_k_memview[] = "memview";
2747 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2748 static const char __pyx_k_float128[] = "float128";
2749 static const char __pyx_k_getstate[] = "__getstate__";
2750 static const char __pyx_k_issparse[] = "issparse";
2751 static const char __pyx_k_itemsize[] = "itemsize";
2752 static const char __pyx_k_pyx_type[] = "__pyx_type";
2753 static const char __pyx_k_setstate[] = "__setstate__";
2754 static const char __pyx_k_A_indices[] = "A_indices";
2755 static const char __pyx_k_TypeError[] = "TypeError";
2756 static const char __pyx_k_enumerate[] = "enumerate";
2757 static const char __pyx_k_pycMatrix[] = "pycMatrix";
2758 static const char __pyx_k_pyx_state[] = "__pyx_state";
2759 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2760 static const char __pyx_k_A_num_rows[] = "A_num_rows";
2761 static const char __pyx_k_IndexError[] = "IndexError";
2762 static const char __pyx_k_ValueError[] = "ValueError";
2763 static const char __pyx_k_csr_matrix[] = "csr_matrix";
2764 static const char __pyx_k_pyx_result[] = "__pyx_result";
2765 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2766 static const char __pyx_k_MemoryError[] = "MemoryError";
2767 static const char __pyx_k_PickleError[] = "PickleError";
2768 static const char __pyx_k_A_data_float[] = "A_data_float";
2769 static const char __pyx_k_A_indices_mv[] = "A_indices_mv";
2770 static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
2771 static const char __pyx_k_F_CONTIGUOUS[] = "F_CONTIGUOUS";
2772 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2773 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2774 static const char __pyx_k_sort_indices[] = "sort_indices";
2775 static const char __pyx_k_stringsource[] = "stringsource";
2776 static const char __pyx_k_A_data_double[] = "A_data_double";
2777 static const char __pyx_k_A_num_columns[] = "A_num_columns";
2778 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2779 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2780 static const char __pyx_k_A_is_row_major[] = "A_is_row_major";
2781 static const char __pyx_k_isspmatrix_csc[] = "isspmatrix_csc";
2782 static const char __pyx_k_isspmatrix_csr[] = "isspmatrix_csr";
2783 static const char __pyx_k_A_data_float_mv[] = "A_data_float_mv";
2784 static const char __pyx_k_A_index_pointer[] = "A_index_pointer";
2785 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2786 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2787 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2788 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2789 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2790 static const char __pyx_k_A_cannot_be_None[] = "A cannot be None.";
2791 static const char __pyx_k_A_data_double_mv[] = "A_data_double_mv";
2792 static const char __pyx_k_A_data_float_mv_c[] = "A_data_float_mv_c";
2793 static const char __pyx_k_A_data_float_mv_f[] = "A_data_float_mv_f";
2794 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2795 static const char __pyx_k_A_data_double_mv_c[] = "A_data_double_mv_c";
2796 static const char __pyx_k_A_data_double_mv_f[] = "A_data_double_mv_f";
2797 static const char __pyx_k_A_data_long_double[] = "A_data_long_double";
2798 static const char __pyx_k_A_index_pointer_mv[] = "A_index_pointer_mv";
2799 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2800 static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
2801 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2802 static const char __pyx_k_set_csc_matrix_float[] = "set_csc_matrix_float";
2803 static const char __pyx_k_set_csr_matrix_float[] = "set_csr_matrix_float";
2804 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2805 static const char __pyx_k_A_data_long_double_mv[] = "A_data_long_double_mv";
2806 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2807 static const char __pyx_k_set_csc_matrix_double[] = "set_csc_matrix_double";
2808 static const char __pyx_k_set_csr_matrix_double[] = "set_csr_matrix_double";
2809 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2810 static const char __pyx_k_set_dense_matrix_float[] = "set_dense_matrix_float";
2811 static const char __pyx_k_A_data_long_double_mv_c[] = "A_data_long_double_mv_c";
2812 static const char __pyx_k_A_data_long_double_mv_f[] = "A_data_long_double_mv_f";
2813 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2814 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2815 static const char __pyx_k_set_dense_matrix_double[] = "set_dense_matrix_double";
2816 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2817 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2818 static const char __pyx_k_pycMatrix___reduce_cython[] = "pycMatrix.__reduce_cython__";
2819 static const char __pyx_k_set_csc_matrix_long_double[] = "set_csc_matrix_long_double";
2820 static const char __pyx_k_set_csr_matrix_long_double[] = "set_csr_matrix_long_double";
2821 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2822 static const char __pyx_k_pycMatrix___setstate_cython[] = "pycMatrix.__setstate_cython__";
2823 static const char __pyx_k_set_dense_matrix_long_double[] = "set_dense_matrix_long_double";
2824 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2825 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float";
2826 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float";
2827 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2828 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double";
2829 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double";
2830 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] = "pycMatrix.set_dense_matrix_long_double";
2831 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2832 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2833 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2834 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2835 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be \"float32\", \"float64\", or \"float128\".";
2836 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2837 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2838 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2839 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] = "Input matrix should be a 2-dimensional array.";
2840 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2841 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] = "Matrix A should be either C or F contiguous.";
2842 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2843 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2844 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2845 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] = "imate/_c_linear_operator/py_c_matrix.pyx";
2846 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2847 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] = "pycMatrix.set_csc_matrix_long_double";
2848 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] = "pycMatrix.set_csr_matrix_long_double";
2849 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] = "pycMatrix.set_dense_matrix_double";
2850 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float";
2851 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2852 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] = "imate._c_linear_operator.py_c_matrix";
2853 static PyObject *__pyx_n_s_A;
2854 static PyObject *__pyx_n_s_ASCII;
2855 static PyObject *__pyx_kp_u_A_cannot_be_None;
2856 static PyObject *__pyx_n_s_A_data_double;
2857 static PyObject *__pyx_n_s_A_data_double_mv;
2858 static PyObject *__pyx_n_s_A_data_double_mv_c;
2859 static PyObject *__pyx_n_s_A_data_double_mv_f;
2860 static PyObject *__pyx_n_s_A_data_float;
2861 static PyObject *__pyx_n_s_A_data_float_mv;
2862 static PyObject *__pyx_n_s_A_data_float_mv_c;
2863 static PyObject *__pyx_n_s_A_data_float_mv_f;
2864 static PyObject *__pyx_n_s_A_data_long_double;
2865 static PyObject *__pyx_n_s_A_data_long_double_mv;
2866 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2867 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2868 static PyObject *__pyx_n_s_A_index_pointer;
2869 static PyObject *__pyx_n_s_A_index_pointer_mv;
2870 static PyObject *__pyx_n_s_A_indices;
2871 static PyObject *__pyx_n_s_A_indices_mv;
2872 static PyObject *__pyx_n_s_A_is_row_major;
2873 static PyObject *__pyx_n_s_A_num_columns;
2874 static PyObject *__pyx_n_s_A_num_rows;
2875 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2876 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2877 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2878 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2879 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2880 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2881 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2882 static PyObject *__pyx_n_s_Ellipsis;
2883 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2884 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2885 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2886 static PyObject *__pyx_n_s_IndexError;
2887 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2888 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2889 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2890 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2891 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2892 static PyObject *__pyx_n_s_MemoryError;
2893 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2894 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2895 static PyObject *__pyx_n_b_O;
2896 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2897 static PyObject *__pyx_n_s_PickleError;
2898 static PyObject *__pyx_n_s_TypeError;
2899 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2900 static PyObject *__pyx_n_s_ValueError;
2901 static PyObject *__pyx_n_s_View_MemoryView;
2902 static PyObject *__pyx_n_s_allocate_buffer;
2903 static PyObject *__pyx_n_s_astype;
2904 static PyObject *__pyx_n_s_base;
2905 static PyObject *__pyx_n_s_c;
2906 static PyObject *__pyx_n_u_c;
2907 static PyObject *__pyx_n_s_class;
2908 static PyObject *__pyx_n_s_cline_in_traceback;
2909 static PyObject *__pyx_kp_s_contiguous_and_direct;
2910 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2911 static PyObject *__pyx_n_s_copy;
2912 static PyObject *__pyx_n_s_csr_matrix;
2913 static PyObject *__pyx_n_s_data;
2914 static PyObject *__pyx_n_s_dict;
2915 static PyObject *__pyx_n_s_dtype;
2916 static PyObject *__pyx_n_s_dtype_is_object;
2917 static PyObject *__pyx_n_s_encode;
2918 static PyObject *__pyx_n_s_enumerate;
2919 static PyObject *__pyx_n_s_error;
2920 static PyObject *__pyx_n_s_flags;
2921 static PyObject *__pyx_n_b_float128;
2922 static PyObject *__pyx_n_b_float32;
2923 static PyObject *__pyx_n_b_float64;
2924 static PyObject *__pyx_n_s_format;
2925 static PyObject *__pyx_n_s_fortran;
2926 static PyObject *__pyx_n_u_fortran;
2927 static PyObject *__pyx_n_s_getstate;
2928 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2929 static PyObject *__pyx_n_s_has_sorted_indices;
2930 static PyObject *__pyx_n_s_id;
2931 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2932 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2933 static PyObject *__pyx_n_s_import;
2934 static PyObject *__pyx_n_s_indices;
2935 static PyObject *__pyx_n_s_indptr;
2936 static PyObject *__pyx_n_s_issparse;
2937 static PyObject *__pyx_n_s_isspmatrix_csc;
2938 static PyObject *__pyx_n_s_isspmatrix_csr;
2939 static PyObject *__pyx_n_s_itemsize;
2940 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2941 static PyObject *__pyx_n_s_main;
2942 static PyObject *__pyx_n_s_memview;
2943 static PyObject *__pyx_n_s_mode;
2944 static PyObject *__pyx_n_s_name;
2945 static PyObject *__pyx_n_s_name_2;
2946 static PyObject *__pyx_n_s_ndim;
2947 static PyObject *__pyx_n_s_new;
2948 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2949 static PyObject *__pyx_n_s_numpy;
2950 static PyObject *__pyx_n_s_obj;
2951 static PyObject *__pyx_n_s_pack;
2952 static PyObject *__pyx_n_s_pickle;
2953 static PyObject *__pyx_n_s_pycMatrix;
2954 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2955 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2956 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2957 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2958 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2959 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2960 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2961 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2962 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2963 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2964 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2965 static PyObject *__pyx_n_s_pyx_PickleError;
2966 static PyObject *__pyx_n_s_pyx_checksum;
2967 static PyObject *__pyx_n_s_pyx_getbuffer;
2968 static PyObject *__pyx_n_s_pyx_result;
2969 static PyObject *__pyx_n_s_pyx_state;
2970 static PyObject *__pyx_n_s_pyx_type;
2971 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2972 static PyObject *__pyx_n_s_pyx_vtable;
2973 static PyObject *__pyx_n_s_range;
2974 static PyObject *__pyx_n_s_reduce;
2975 static PyObject *__pyx_n_s_reduce_cython;
2976 static PyObject *__pyx_n_s_reduce_ex;
2977 static PyObject *__pyx_n_s_scipy_sparse;
2978 static PyObject *__pyx_n_s_self;
2979 static PyObject *__pyx_n_s_set_csc_matrix_double;
2980 static PyObject *__pyx_n_s_set_csc_matrix_float;
2981 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2982 static PyObject *__pyx_n_s_set_csr_matrix_double;
2983 static PyObject *__pyx_n_s_set_csr_matrix_float;
2984 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2985 static PyObject *__pyx_n_s_set_dense_matrix_double;
2986 static PyObject *__pyx_n_s_set_dense_matrix_float;
2987 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2988 static PyObject *__pyx_n_s_setstate;
2989 static PyObject *__pyx_n_s_setstate_cython;
2990 static PyObject *__pyx_n_s_shape;
2991 static PyObject *__pyx_n_s_size;
2992 static PyObject *__pyx_n_s_sort_indices;
2993 static PyObject *__pyx_n_s_start;
2994 static PyObject *__pyx_n_s_step;
2995 static PyObject *__pyx_n_s_stop;
2996 static PyObject *__pyx_kp_s_strided_and_direct;
2997 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2998 static PyObject *__pyx_kp_s_strided_and_indirect;
2999 static PyObject *__pyx_kp_s_stringsource;
3000 static PyObject *__pyx_n_s_struct;
3001 static PyObject *__pyx_n_s_test;
3002 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3003 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3004 static PyObject *__pyx_n_s_unpack;
3005 static PyObject *__pyx_n_s_update;
3006 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3007 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3008 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3009 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3010 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3011 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3012 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3013 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3014 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3015 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
3016 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self); /* proto */
3017 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3018 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3019 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3020 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3021 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3022 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3023 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3024 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3025 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3026 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3027 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3028 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3029 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3030 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3031 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3032 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3033 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3034 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3035 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3036 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3037 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3038 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3039 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3040 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3041 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3042 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3043 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3044 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3046 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3047 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3048 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3049 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3050 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3051 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3052 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3053 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3054 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3055 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3056 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3057 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3058 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3059 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3060 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3061 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3062 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3063 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3064 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3065 static PyObject *__pyx_int_0;
3066 static PyObject *__pyx_int_1;
3067 static PyObject *__pyx_int_2;
3068 static PyObject *__pyx_int_112105877;
3069 static PyObject *__pyx_int_136983863;
3070 static PyObject *__pyx_int_184977713;
3071 static PyObject *__pyx_int_neg_1;
3072 static PyObject *__pyx_tuple_;
3073 static PyObject *__pyx_tuple__2;
3074 static PyObject *__pyx_tuple__3;
3075 static PyObject *__pyx_tuple__5;
3076 static PyObject *__pyx_slice__32;
3077 static PyObject *__pyx_tuple__15;
3078 static PyObject *__pyx_tuple__17;
3079 static PyObject *__pyx_tuple__18;
3080 static PyObject *__pyx_tuple__19;
3081 static PyObject *__pyx_tuple__20;
3082 static PyObject *__pyx_tuple__21;
3083 static PyObject *__pyx_tuple__22;
3084 static PyObject *__pyx_tuple__23;
3085 static PyObject *__pyx_tuple__24;
3086 static PyObject *__pyx_tuple__25;
3087 static PyObject *__pyx_tuple__26;
3088 static PyObject *__pyx_tuple__27;
3089 static PyObject *__pyx_tuple__28;
3090 static PyObject *__pyx_tuple__29;
3091 static PyObject *__pyx_tuple__30;
3092 static PyObject *__pyx_tuple__31;
3093 static PyObject *__pyx_tuple__33;
3094 static PyObject *__pyx_tuple__34;
3095 static PyObject *__pyx_tuple__35;
3096 static PyObject *__pyx_tuple__37;
3097 static PyObject *__pyx_tuple__38;
3098 static PyObject *__pyx_tuple__39;
3099 static PyObject *__pyx_tuple__40;
3100 static PyObject *__pyx_tuple__41;
3101 static PyObject *__pyx_tuple__42;
3102 static PyObject *__pyx_tuple__43;
3103 static PyObject *__pyx_tuple__44;
3104 static PyObject *__pyx_tuple__45;
3105 static PyObject *__pyx_tuple__46;
3106 static PyObject *__pyx_tuple__47;
3107 static PyObject *__pyx_tuple__48;
3108 static PyObject *__pyx_tuple__49;
3109 static PyObject *__pyx_tuple__50;
3110 static PyObject *__pyx_tuple__51;
3111 static PyObject *__pyx_tuple__52;
3112 static PyObject *__pyx_tuple__53;
3113 static PyObject *__pyx_tuple__54;
3114 static PyObject *__pyx_codeobj__4;
3115 static PyObject *__pyx_codeobj__6;
3116 static PyObject *__pyx_codeobj__7;
3117 static PyObject *__pyx_codeobj__8;
3118 static PyObject *__pyx_codeobj__9;
3119 static PyObject *__pyx_codeobj__10;
3120 static PyObject *__pyx_codeobj__11;
3121 static PyObject *__pyx_codeobj__12;
3122 static PyObject *__pyx_codeobj__13;
3123 static PyObject *__pyx_codeobj__14;
3124 static PyObject *__pyx_codeobj__16;
3125 static PyObject *__pyx_codeobj__36;
3126 /* Late includes */
3127 
3128 /* "imate/_c_linear_operator/py_c_matrix.pyx":119
3129  * # =========
3130  *
3131  * def __cinit__(self, A): # <<<<<<<<<<<<<<
3132  * """
3133  * Sets the matrix A.
3134  */
3135 
3136 /* Python wrapper */
3137 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3138 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3139  PyObject *__pyx_v_A = 0;
3140  int __pyx_lineno = 0;
3141  const char *__pyx_filename = NULL;
3142  int __pyx_clineno = 0;
3143  int __pyx_r;
3144  __Pyx_RefNannyDeclarations
3145  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3146  {
3147  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
3148  PyObject* values[1] = {0};
3149  if (unlikely(__pyx_kwds)) {
3150  Py_ssize_t kw_args;
3151  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3152  switch (pos_args) {
3153  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3154  CYTHON_FALLTHROUGH;
3155  case 0: break;
3156  default: goto __pyx_L5_argtuple_error;
3157  }
3158  kw_args = PyDict_Size(__pyx_kwds);
3159  switch (pos_args) {
3160  case 0:
3161  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3162  else goto __pyx_L5_argtuple_error;
3163  }
3164  if (unlikely(kw_args > 0)) {
3165  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
3166  }
3167  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3168  goto __pyx_L5_argtuple_error;
3169  } else {
3170  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3171  }
3172  __pyx_v_A = values[0];
3173  }
3174  goto __pyx_L4_argument_unpacking_done;
3175  __pyx_L5_argtuple_error:;
3176  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
3177  __pyx_L3_error:;
3178  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3179  __Pyx_RefNannyFinishContext();
3180  return -1;
3181  __pyx_L4_argument_unpacking_done:;
3182  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
3183 
3184  /* function exit code */
3185  __Pyx_RefNannyFinishContext();
3186  return __pyx_r;
3187 }
3188 
3189 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
3190  int __pyx_r;
3191  __Pyx_TraceDeclarations
3192  __Pyx_RefNannyDeclarations
3193  int __pyx_t_1;
3194  int __pyx_t_2;
3195  PyObject *__pyx_t_3 = NULL;
3196  PyObject *__pyx_t_4 = NULL;
3197  PyObject *__pyx_t_5 = NULL;
3198  int __pyx_lineno = 0;
3199  const char *__pyx_filename = NULL;
3200  int __pyx_clineno = 0;
3201  __Pyx_RefNannySetupContext("__cinit__", 0);
3202  __Pyx_TraceCall("__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
3203 
3204  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
3205  *
3206  * # Check A
3207  * if A is None: # <<<<<<<<<<<<<<
3208  * raise ValueError('A cannot be None.')
3209  *
3210  */
3211  __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3212  __pyx_t_1 = (__pyx_v_A == Py_None);
3213  __pyx_t_2 = (__pyx_t_1 != 0);
3214  if (unlikely(__pyx_t_2)) {
3215 
3216  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
3217  * # Check A
3218  * if A is None:
3219  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
3220  *
3221  * if A.ndim != 2:
3222  */
3223  __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
3224  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
3225  __Pyx_GOTREF(__pyx_t_3);
3226  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3228  __PYX_ERR(0, 126, __pyx_L1_error)
3229 
3230  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
3231  *
3232  * # Check A
3233  * if A is None: # <<<<<<<<<<<<<<
3234  * raise ValueError('A cannot be None.')
3235  *
3236  */
3237  }
3238 
3239  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
3240  * raise ValueError('A cannot be None.')
3241  *
3242  * if A.ndim != 2: # <<<<<<<<<<<<<<
3243  * raise ValueError('Input matrix should be a 2-dimensional array.')
3244  *
3245  */
3246  __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
3247  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
3248  __Pyx_GOTREF(__pyx_t_3);
3249  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
3250  __Pyx_GOTREF(__pyx_t_4);
3251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3252  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
3253  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3254  if (unlikely(__pyx_t_2)) {
3255 
3256  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
3257  *
3258  * if A.ndim != 2:
3259  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
3260  *
3261  * # Data type
3262  */
3263  __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
3264  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
3265  __Pyx_GOTREF(__pyx_t_4);
3266  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3268  __PYX_ERR(0, 129, __pyx_L1_error)
3269 
3270  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
3271  * raise ValueError('A cannot be None.')
3272  *
3273  * if A.ndim != 2: # <<<<<<<<<<<<<<
3274  * raise ValueError('Input matrix should be a 2-dimensional array.')
3275  *
3276  */
3277  }
3278 
3279  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
3280  *
3281  * # Data type
3282  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3283  * self.data_type_name = b'float32'
3284  *
3285  */
3286  __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
3287  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
3288  __Pyx_GOTREF(__pyx_t_4);
3289  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
3290  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3291  if (__pyx_t_2) {
3292 
3293  /* "imate/_c_linear_operator/py_c_matrix.pyx":133
3294  * # Data type
3295  * if A.dtype == b'float32':
3296  * self.data_type_name = b'float32' # <<<<<<<<<<<<<<
3297  *
3298  * elif A.dtype == b'float64':
3299  */
3300  __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
3301  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float32");
3302 
3303  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
3304  *
3305  * # Data type
3306  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3307  * self.data_type_name = b'float32'
3308  *
3309  */
3310  goto __pyx_L5;
3311  }
3312 
3313  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3314  * self.data_type_name = b'float32'
3315  *
3316  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3317  * self.data_type_name = b'float64'
3318  *
3319  */
3320  __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3321  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3322  __Pyx_GOTREF(__pyx_t_4);
3323  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3324  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3325  if (__pyx_t_2) {
3326 
3327  /* "imate/_c_linear_operator/py_c_matrix.pyx":136
3328  *
3329  * elif A.dtype == b'float64':
3330  * self.data_type_name = b'float64' # <<<<<<<<<<<<<<
3331  *
3332  * elif A.dtype == b'float128':
3333  */
3334  __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3335  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float64");
3336 
3337  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3338  * self.data_type_name = b'float32'
3339  *
3340  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3341  * self.data_type_name = b'float64'
3342  *
3343  */
3344  goto __pyx_L5;
3345  }
3346 
3347  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3348  * self.data_type_name = b'float64'
3349  *
3350  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3351  * self.data_type_name = b'float128'
3352  *
3353  */
3354  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3355  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3356  __Pyx_GOTREF(__pyx_t_4);
3357  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3358  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3359  if (likely(__pyx_t_2)) {
3360 
3361  /* "imate/_c_linear_operator/py_c_matrix.pyx":139
3362  *
3363  * elif A.dtype == b'float128':
3364  * self.data_type_name = b'float128' # <<<<<<<<<<<<<<
3365  *
3366  * else:
3367  */
3368  __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3369  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float128");
3370 
3371  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3372  * self.data_type_name = b'float64'
3373  *
3374  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3375  * self.data_type_name = b'float128'
3376  *
3377  */
3378  goto __pyx_L5;
3379  }
3380 
3381  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
3382  *
3383  * else:
3384  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
3385  * '"float128".')
3386  *
3387  */
3388  __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3389  /*else*/ {
3390  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3391  __Pyx_GOTREF(__pyx_t_4);
3392  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3393  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3394  __PYX_ERR(0, 142, __pyx_L1_error)
3395  }
3396  __pyx_L5:;
3397 
3398  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
3399  *
3400  * # Determine A is sparse or dense
3401  * if issparse(A): # <<<<<<<<<<<<<<
3402  *
3403  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3404  */
3405  __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3406  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3407  __Pyx_GOTREF(__pyx_t_3);
3408  __pyx_t_5 = NULL;
3409  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3410  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3411  if (likely(__pyx_t_5)) {
3412  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3413  __Pyx_INCREF(__pyx_t_5);
3414  __Pyx_INCREF(function);
3415  __Pyx_DECREF_SET(__pyx_t_3, function);
3416  }
3417  }
3418  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3419  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3420  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3421  __Pyx_GOTREF(__pyx_t_4);
3422  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3423  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3424  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3425  if (__pyx_t_2) {
3426 
3427  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3428  *
3429  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3430  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3431  *
3432  * # Check sorted indices
3433  */
3434  __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3435  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3436  __Pyx_GOTREF(__pyx_t_3);
3437  __pyx_t_5 = NULL;
3438  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3439  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3440  if (likely(__pyx_t_5)) {
3441  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3442  __Pyx_INCREF(__pyx_t_5);
3443  __Pyx_INCREF(function);
3444  __Pyx_DECREF_SET(__pyx_t_3, function);
3445  }
3446  }
3447  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3448  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3449  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3450  __Pyx_GOTREF(__pyx_t_4);
3451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3452  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3453  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3454  if (__pyx_t_2) {
3455 
3456  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3457  *
3458  * # Check sorted indices
3459  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3460  * A.sort_indices()
3461  *
3462  */
3463  __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3464  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3465  __Pyx_GOTREF(__pyx_t_4);
3466  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3467  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3468  __pyx_t_1 = ((!__pyx_t_2) != 0);
3469  if (__pyx_t_1) {
3470 
3471  /* "imate/_c_linear_operator/py_c_matrix.pyx":153
3472  * # Check sorted indices
3473  * if not A.has_sorted_indices:
3474  * A.sort_indices() # <<<<<<<<<<<<<<
3475  *
3476  * # CSR matrix
3477  */
3478  __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3479  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3480  __Pyx_GOTREF(__pyx_t_3);
3481  __pyx_t_5 = NULL;
3482  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3483  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3484  if (likely(__pyx_t_5)) {
3485  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3486  __Pyx_INCREF(__pyx_t_5);
3487  __Pyx_INCREF(function);
3488  __Pyx_DECREF_SET(__pyx_t_3, function);
3489  }
3490  }
3491  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3492  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3493  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3494  __Pyx_GOTREF(__pyx_t_4);
3495  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3496  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3497 
3498  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3499  *
3500  * # Check sorted indices
3501  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3502  * A.sort_indices()
3503  *
3504  */
3505  }
3506 
3507  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3508  *
3509  * # CSR matrix
3510  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3511  * self.set_csr_matrix_float(A)
3512  *
3513  */
3514  __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3515  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3516  __Pyx_GOTREF(__pyx_t_4);
3517  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3518  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3519  if (__pyx_t_1) {
3520 
3521  /* "imate/_c_linear_operator/py_c_matrix.pyx":157
3522  * # CSR matrix
3523  * if self.data_type_name == b'float32':
3524  * self.set_csr_matrix_float(A) # <<<<<<<<<<<<<<
3525  *
3526  * elif self.data_type_name == b'float64':
3527  */
3528  __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3529  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3530  __Pyx_GOTREF(__pyx_t_3);
3531  __pyx_t_5 = NULL;
3532  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3533  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3534  if (likely(__pyx_t_5)) {
3535  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3536  __Pyx_INCREF(__pyx_t_5);
3537  __Pyx_INCREF(function);
3538  __Pyx_DECREF_SET(__pyx_t_3, function);
3539  }
3540  }
3541  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3542  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3543  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3544  __Pyx_GOTREF(__pyx_t_4);
3545  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3546  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3547 
3548  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3549  *
3550  * # CSR matrix
3551  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3552  * self.set_csr_matrix_float(A)
3553  *
3554  */
3555  goto __pyx_L9;
3556  }
3557 
3558  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3559  * self.set_csr_matrix_float(A)
3560  *
3561  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3562  * self.set_csr_matrix_double(A)
3563  *
3564  */
3565  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3566  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3567  __Pyx_GOTREF(__pyx_t_4);
3568  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3569  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3570  if (__pyx_t_1) {
3571 
3572  /* "imate/_c_linear_operator/py_c_matrix.pyx":160
3573  *
3574  * elif self.data_type_name == b'float64':
3575  * self.set_csr_matrix_double(A) # <<<<<<<<<<<<<<
3576  *
3577  * elif self.data_type_name == b'float128':
3578  */
3579  __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3580  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3581  __Pyx_GOTREF(__pyx_t_3);
3582  __pyx_t_5 = NULL;
3583  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3584  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3585  if (likely(__pyx_t_5)) {
3586  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3587  __Pyx_INCREF(__pyx_t_5);
3588  __Pyx_INCREF(function);
3589  __Pyx_DECREF_SET(__pyx_t_3, function);
3590  }
3591  }
3592  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3593  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3594  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3595  __Pyx_GOTREF(__pyx_t_4);
3596  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3597  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3598 
3599  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3600  * self.set_csr_matrix_float(A)
3601  *
3602  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3603  * self.set_csr_matrix_double(A)
3604  *
3605  */
3606  goto __pyx_L9;
3607  }
3608 
3609  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3610  * self.set_csr_matrix_double(A)
3611  *
3612  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3613  * self.set_csr_matrix_long_double(A)
3614  *
3615  */
3616  __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3617  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3618  __Pyx_GOTREF(__pyx_t_4);
3619  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3620  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3621  if (__pyx_t_1) {
3622 
3623  /* "imate/_c_linear_operator/py_c_matrix.pyx":163
3624  *
3625  * elif self.data_type_name == b'float128':
3626  * self.set_csr_matrix_long_double(A) # <<<<<<<<<<<<<<
3627  *
3628  * elif isspmatrix_csc(A):
3629  */
3630  __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3631  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3632  __Pyx_GOTREF(__pyx_t_3);
3633  __pyx_t_5 = NULL;
3634  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3635  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3636  if (likely(__pyx_t_5)) {
3637  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3638  __Pyx_INCREF(__pyx_t_5);
3639  __Pyx_INCREF(function);
3640  __Pyx_DECREF_SET(__pyx_t_3, function);
3641  }
3642  }
3643  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3644  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3645  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3646  __Pyx_GOTREF(__pyx_t_4);
3647  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3648  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3649 
3650  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3651  * self.set_csr_matrix_double(A)
3652  *
3653  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3654  * self.set_csr_matrix_long_double(A)
3655  *
3656  */
3657  }
3658  __pyx_L9:;
3659 
3660  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3661  *
3662  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3663  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3664  *
3665  * # Check sorted indices
3666  */
3667  goto __pyx_L7;
3668  }
3669 
3670  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3671  * self.set_csr_matrix_long_double(A)
3672  *
3673  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3674  *
3675  * # Check sorted indices
3676  */
3677  __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3678  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3679  __Pyx_GOTREF(__pyx_t_3);
3680  __pyx_t_5 = NULL;
3681  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3682  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3683  if (likely(__pyx_t_5)) {
3684  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3685  __Pyx_INCREF(__pyx_t_5);
3686  __Pyx_INCREF(function);
3687  __Pyx_DECREF_SET(__pyx_t_3, function);
3688  }
3689  }
3690  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3691  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3692  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3693  __Pyx_GOTREF(__pyx_t_4);
3694  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3695  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3696  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3697  if (__pyx_t_1) {
3698 
3699  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3700  *
3701  * # Check sorted indices
3702  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3703  * A.sort_indices()
3704  *
3705  */
3706  __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3707  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3708  __Pyx_GOTREF(__pyx_t_4);
3709  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3710  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3711  __pyx_t_2 = ((!__pyx_t_1) != 0);
3712  if (__pyx_t_2) {
3713 
3714  /* "imate/_c_linear_operator/py_c_matrix.pyx":169
3715  * # Check sorted indices
3716  * if not A.has_sorted_indices:
3717  * A.sort_indices() # <<<<<<<<<<<<<<
3718  *
3719  * # CSC matrix
3720  */
3721  __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3722  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3723  __Pyx_GOTREF(__pyx_t_3);
3724  __pyx_t_5 = NULL;
3725  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3726  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3727  if (likely(__pyx_t_5)) {
3728  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3729  __Pyx_INCREF(__pyx_t_5);
3730  __Pyx_INCREF(function);
3731  __Pyx_DECREF_SET(__pyx_t_3, function);
3732  }
3733  }
3734  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3735  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3736  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3737  __Pyx_GOTREF(__pyx_t_4);
3738  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3739  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3740 
3741  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3742  *
3743  * # Check sorted indices
3744  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3745  * A.sort_indices()
3746  *
3747  */
3748  }
3749 
3750  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3751  *
3752  * # CSC matrix
3753  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3754  * self.set_csc_matrix_float(A)
3755  *
3756  */
3757  __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3758  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3759  __Pyx_GOTREF(__pyx_t_4);
3760  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3761  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3762  if (__pyx_t_2) {
3763 
3764  /* "imate/_c_linear_operator/py_c_matrix.pyx":173
3765  * # CSC matrix
3766  * if self.data_type_name == b'float32':
3767  * self.set_csc_matrix_float(A) # <<<<<<<<<<<<<<
3768  *
3769  * elif self.data_type_name == b'float64':
3770  */
3771  __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3772  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3773  __Pyx_GOTREF(__pyx_t_3);
3774  __pyx_t_5 = NULL;
3775  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3776  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3777  if (likely(__pyx_t_5)) {
3778  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3779  __Pyx_INCREF(__pyx_t_5);
3780  __Pyx_INCREF(function);
3781  __Pyx_DECREF_SET(__pyx_t_3, function);
3782  }
3783  }
3784  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3785  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3786  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3787  __Pyx_GOTREF(__pyx_t_4);
3788  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3789  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3790 
3791  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3792  *
3793  * # CSC matrix
3794  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3795  * self.set_csc_matrix_float(A)
3796  *
3797  */
3798  goto __pyx_L11;
3799  }
3800 
3801  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3802  * self.set_csc_matrix_float(A)
3803  *
3804  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3805  * self.set_csc_matrix_double(A)
3806  *
3807  */
3808  __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3809  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3810  __Pyx_GOTREF(__pyx_t_4);
3811  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3812  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3813  if (__pyx_t_2) {
3814 
3815  /* "imate/_c_linear_operator/py_c_matrix.pyx":176
3816  *
3817  * elif self.data_type_name == b'float64':
3818  * self.set_csc_matrix_double(A) # <<<<<<<<<<<<<<
3819  *
3820  * elif self.data_type_name == b'float128':
3821  */
3822  __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3823  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3824  __Pyx_GOTREF(__pyx_t_3);
3825  __pyx_t_5 = NULL;
3826  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3827  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3828  if (likely(__pyx_t_5)) {
3829  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3830  __Pyx_INCREF(__pyx_t_5);
3831  __Pyx_INCREF(function);
3832  __Pyx_DECREF_SET(__pyx_t_3, function);
3833  }
3834  }
3835  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3836  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3837  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3838  __Pyx_GOTREF(__pyx_t_4);
3839  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3840  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3841 
3842  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3843  * self.set_csc_matrix_float(A)
3844  *
3845  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3846  * self.set_csc_matrix_double(A)
3847  *
3848  */
3849  goto __pyx_L11;
3850  }
3851 
3852  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3853  * self.set_csc_matrix_double(A)
3854  *
3855  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3856  * self.set_csc_matrix_long_double(A)
3857  *
3858  */
3859  __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3860  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3861  __Pyx_GOTREF(__pyx_t_4);
3862  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3863  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3864  if (__pyx_t_2) {
3865 
3866  /* "imate/_c_linear_operator/py_c_matrix.pyx":179
3867  *
3868  * elif self.data_type_name == b'float128':
3869  * self.set_csc_matrix_long_double(A) # <<<<<<<<<<<<<<
3870  *
3871  * else:
3872  */
3873  __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3874  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3875  __Pyx_GOTREF(__pyx_t_3);
3876  __pyx_t_5 = NULL;
3877  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3878  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3879  if (likely(__pyx_t_5)) {
3880  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3881  __Pyx_INCREF(__pyx_t_5);
3882  __Pyx_INCREF(function);
3883  __Pyx_DECREF_SET(__pyx_t_3, function);
3884  }
3885  }
3886  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3887  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3888  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3889  __Pyx_GOTREF(__pyx_t_4);
3890  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3891  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3892 
3893  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3894  * self.set_csc_matrix_double(A)
3895  *
3896  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3897  * self.set_csc_matrix_long_double(A)
3898  *
3899  */
3900  }
3901  __pyx_L11:;
3902 
3903  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3904  * self.set_csr_matrix_long_double(A)
3905  *
3906  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3907  *
3908  * # Check sorted indices
3909  */
3910  goto __pyx_L7;
3911  }
3912 
3913  /* "imate/_c_linear_operator/py_c_matrix.pyx":184
3914  *
3915  * # If A is neither CSR or CSC, convert A to CSR
3916  * self.A_csr = csr_matrix(A) # <<<<<<<<<<<<<<
3917  *
3918  * # Check sorted indices
3919  */
3920  __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3921  /*else*/ {
3922  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3923  __Pyx_GOTREF(__pyx_t_3);
3924  __pyx_t_5 = NULL;
3925  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3926  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3927  if (likely(__pyx_t_5)) {
3928  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3929  __Pyx_INCREF(__pyx_t_5);
3930  __Pyx_INCREF(function);
3931  __Pyx_DECREF_SET(__pyx_t_3, function);
3932  }
3933  }
3934  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3935  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3936  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3937  __Pyx_GOTREF(__pyx_t_4);
3938  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3939  __Pyx_GIVEREF(__pyx_t_4);
3940  __Pyx_GOTREF(__pyx_v_self->A_csr);
3941  __Pyx_DECREF(__pyx_v_self->A_csr);
3942  __pyx_v_self->A_csr = __pyx_t_4;
3943  __pyx_t_4 = 0;
3944 
3945  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3946  *
3947  * # Check sorted indices
3948  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3949  * self.A_csr.sort_indices()
3950  *
3951  */
3952  __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3953  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3954  __Pyx_GOTREF(__pyx_t_4);
3955  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3956  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3957  __pyx_t_1 = ((!__pyx_t_2) != 0);
3958  if (__pyx_t_1) {
3959 
3960  /* "imate/_c_linear_operator/py_c_matrix.pyx":188
3961  * # Check sorted indices
3962  * if not self.A_csr.has_sorted_indices:
3963  * self.A_csr.sort_indices() # <<<<<<<<<<<<<<
3964  *
3965  * # CSR matrix
3966  */
3967  __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3968  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3969  __Pyx_GOTREF(__pyx_t_3);
3970  __pyx_t_5 = NULL;
3971  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3972  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3973  if (likely(__pyx_t_5)) {
3974  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3975  __Pyx_INCREF(__pyx_t_5);
3976  __Pyx_INCREF(function);
3977  __Pyx_DECREF_SET(__pyx_t_3, function);
3978  }
3979  }
3980  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3981  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3982  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3983  __Pyx_GOTREF(__pyx_t_4);
3984  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3985  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3986 
3987  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3988  *
3989  * # Check sorted indices
3990  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3991  * self.A_csr.sort_indices()
3992  *
3993  */
3994  }
3995 
3996  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
3997  *
3998  * # CSR matrix
3999  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4000  * self.set_csr_matrix_float(self.A_csr)
4001  *
4002  */
4003  __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
4004  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4005  __Pyx_GOTREF(__pyx_t_4);
4006  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
4007  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4008  if (__pyx_t_1) {
4009 
4010  /* "imate/_c_linear_operator/py_c_matrix.pyx":192
4011  * # CSR matrix
4012  * if self.data_type_name == b'float32':
4013  * self.set_csr_matrix_float(self.A_csr) # <<<<<<<<<<<<<<
4014  *
4015  * elif self.data_type_name == b'float64':
4016  */
4017  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
4018  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
4019  __Pyx_GOTREF(__pyx_t_3);
4020  __pyx_t_5 = NULL;
4021  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4022  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4023  if (likely(__pyx_t_5)) {
4024  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4025  __Pyx_INCREF(__pyx_t_5);
4026  __Pyx_INCREF(function);
4027  __Pyx_DECREF_SET(__pyx_t_3, function);
4028  }
4029  }
4030  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4031  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4032  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
4033  __Pyx_GOTREF(__pyx_t_4);
4034  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4035  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4036 
4037  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
4038  *
4039  * # CSR matrix
4040  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4041  * self.set_csr_matrix_float(self.A_csr)
4042  *
4043  */
4044  goto __pyx_L13;
4045  }
4046 
4047  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
4048  * self.set_csr_matrix_float(self.A_csr)
4049  *
4050  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4051  * self.set_csr_matrix_double(self.A_csr)
4052  *
4053  */
4054  __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
4055  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
4056  __Pyx_GOTREF(__pyx_t_4);
4057  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
4058  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4059  if (__pyx_t_1) {
4060 
4061  /* "imate/_c_linear_operator/py_c_matrix.pyx":195
4062  *
4063  * elif self.data_type_name == b'float64':
4064  * self.set_csr_matrix_double(self.A_csr) # <<<<<<<<<<<<<<
4065  *
4066  * elif self.data_type_name == b'float128':
4067  */
4068  __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
4069  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
4070  __Pyx_GOTREF(__pyx_t_3);
4071  __pyx_t_5 = NULL;
4072  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4073  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4074  if (likely(__pyx_t_5)) {
4075  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4076  __Pyx_INCREF(__pyx_t_5);
4077  __Pyx_INCREF(function);
4078  __Pyx_DECREF_SET(__pyx_t_3, function);
4079  }
4080  }
4081  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4082  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4083  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
4084  __Pyx_GOTREF(__pyx_t_4);
4085  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4086  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4087 
4088  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
4089  * self.set_csr_matrix_float(self.A_csr)
4090  *
4091  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4092  * self.set_csr_matrix_double(self.A_csr)
4093  *
4094  */
4095  goto __pyx_L13;
4096  }
4097 
4098  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
4099  * self.set_csr_matrix_double(self.A_csr)
4100  *
4101  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4102  * self.set_csr_matrix_long_double(self.A_csr)
4103  *
4104  */
4105  __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
4106  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
4107  __Pyx_GOTREF(__pyx_t_4);
4108  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
4109  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4110  if (__pyx_t_1) {
4111 
4112  /* "imate/_c_linear_operator/py_c_matrix.pyx":198
4113  *
4114  * elif self.data_type_name == b'float128':
4115  * self.set_csr_matrix_long_double(self.A_csr) # <<<<<<<<<<<<<<
4116  *
4117  * else:
4118  */
4119  __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
4120  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
4121  __Pyx_GOTREF(__pyx_t_3);
4122  __pyx_t_5 = NULL;
4123  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4124  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4125  if (likely(__pyx_t_5)) {
4126  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4127  __Pyx_INCREF(__pyx_t_5);
4128  __Pyx_INCREF(function);
4129  __Pyx_DECREF_SET(__pyx_t_3, function);
4130  }
4131  }
4132  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4133  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4134  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4135  __Pyx_GOTREF(__pyx_t_4);
4136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4137  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4138 
4139  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
4140  * self.set_csr_matrix_double(self.A_csr)
4141  *
4142  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4143  * self.set_csr_matrix_long_double(self.A_csr)
4144  *
4145  */
4146  }
4147  __pyx_L13:;
4148  }
4149  __pyx_L7:;
4150 
4151  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
4152  *
4153  * # Determine A is sparse or dense
4154  * if issparse(A): # <<<<<<<<<<<<<<
4155  *
4156  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
4157  */
4158  goto __pyx_L6;
4159  }
4160 
4161  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
4162  *
4163  * # Set a dense matrix
4164  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4165  * self.set_dense_matrix_float(A)
4166  *
4167  */
4168  __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
4169  /*else*/ {
4170  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
4171  __Pyx_GOTREF(__pyx_t_4);
4172  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
4173  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4174  if (__pyx_t_1) {
4175 
4176  /* "imate/_c_linear_operator/py_c_matrix.pyx":204
4177  * # Set a dense matrix
4178  * if self.data_type_name == b'float32':
4179  * self.set_dense_matrix_float(A) # <<<<<<<<<<<<<<
4180  *
4181  * elif self.data_type_name == b'float64':
4182  */
4183  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
4184  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4185  __Pyx_GOTREF(__pyx_t_3);
4186  __pyx_t_5 = NULL;
4187  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4188  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4189  if (likely(__pyx_t_5)) {
4190  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4191  __Pyx_INCREF(__pyx_t_5);
4192  __Pyx_INCREF(function);
4193  __Pyx_DECREF_SET(__pyx_t_3, function);
4194  }
4195  }
4196  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4197  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4198  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4199  __Pyx_GOTREF(__pyx_t_4);
4200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4201  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4202 
4203  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
4204  *
4205  * # Set a dense matrix
4206  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4207  * self.set_dense_matrix_float(A)
4208  *
4209  */
4210  goto __pyx_L14;
4211  }
4212 
4213  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
4214  * self.set_dense_matrix_float(A)
4215  *
4216  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4217  * self.set_dense_matrix_double(A)
4218  *
4219  */
4220  __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
4221  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
4222  __Pyx_GOTREF(__pyx_t_4);
4223  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
4224  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4225  if (__pyx_t_1) {
4226 
4227  /* "imate/_c_linear_operator/py_c_matrix.pyx":207
4228  *
4229  * elif self.data_type_name == b'float64':
4230  * self.set_dense_matrix_double(A) # <<<<<<<<<<<<<<
4231  *
4232  * elif self.data_type_name == b'float128':
4233  */
4234  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4235  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
4236  __Pyx_GOTREF(__pyx_t_3);
4237  __pyx_t_5 = NULL;
4238  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4239  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4240  if (likely(__pyx_t_5)) {
4241  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4242  __Pyx_INCREF(__pyx_t_5);
4243  __Pyx_INCREF(function);
4244  __Pyx_DECREF_SET(__pyx_t_3, function);
4245  }
4246  }
4247  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4248  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4249  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
4250  __Pyx_GOTREF(__pyx_t_4);
4251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4252  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4253 
4254  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
4255  * self.set_dense_matrix_float(A)
4256  *
4257  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4258  * self.set_dense_matrix_double(A)
4259  *
4260  */
4261  goto __pyx_L14;
4262  }
4263 
4264  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
4265  * self.set_dense_matrix_double(A)
4266  *
4267  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4268  * self.set_dense_matrix_long_double(A)
4269  *
4270  */
4271  __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
4272  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
4273  __Pyx_GOTREF(__pyx_t_4);
4274  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
4275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4276  if (__pyx_t_1) {
4277 
4278  /* "imate/_c_linear_operator/py_c_matrix.pyx":210
4279  *
4280  * elif self.data_type_name == b'float128':
4281  * self.set_dense_matrix_long_double(A) # <<<<<<<<<<<<<<
4282  *
4283  * # ======================
4284  */
4285  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4286  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4287  __Pyx_GOTREF(__pyx_t_3);
4288  __pyx_t_5 = NULL;
4289  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4290  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4291  if (likely(__pyx_t_5)) {
4292  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4293  __Pyx_INCREF(__pyx_t_5);
4294  __Pyx_INCREF(function);
4295  __Pyx_DECREF_SET(__pyx_t_3, function);
4296  }
4297  }
4298  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4299  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4300  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4301  __Pyx_GOTREF(__pyx_t_4);
4302  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4303  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4304 
4305  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
4306  * self.set_dense_matrix_double(A)
4307  *
4308  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4309  * self.set_dense_matrix_long_double(A)
4310  *
4311  */
4312  }
4313  __pyx_L14:;
4314  }
4315  __pyx_L6:;
4316 
4317  /* "imate/_c_linear_operator/py_c_matrix.pyx":119
4318  * # =========
4319  *
4320  * def __cinit__(self, A): # <<<<<<<<<<<<<<
4321  * """
4322  * Sets the matrix A.
4323  */
4324 
4325  /* function exit code */
4326  __pyx_r = 0;
4327  goto __pyx_L0;
4328  __pyx_L1_error:;
4329  __Pyx_XDECREF(__pyx_t_3);
4330  __Pyx_XDECREF(__pyx_t_4);
4331  __Pyx_XDECREF(__pyx_t_5);
4332  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4333  __pyx_r = -1;
4334  __pyx_L0:;
4335  __Pyx_TraceReturn(Py_None, 0);
4336  __Pyx_RefNannyFinishContext();
4337  return __pyx_r;
4338 }
4339 
4340 /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4341  * # ======================
4342  *
4343  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4344  * """
4345  * Sets matrix A.
4346  */
4347 
4348 /* Python wrapper */
4349 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4350 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4351 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4352 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4353  PyObject *__pyx_r = 0;
4354  __Pyx_RefNannyDeclarations
4355  __Pyx_RefNannySetupContext("set_dense_matrix_float (wrapper)", 0);
4356  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4357 
4358  /* function exit code */
4359  __Pyx_RefNannyFinishContext();
4360  return __pyx_r;
4361 }
4362 
4363 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4364  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4365  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4366  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4367  __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4368  __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4369  float *__pyx_v_A_data_float;
4370  PyObject *__pyx_r = NULL;
4371  __Pyx_TraceDeclarations
4372  __Pyx_RefNannyDeclarations
4373  PyObject *__pyx_t_1 = NULL;
4374  PyObject *__pyx_t_2 = NULL;
4375  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4376  int __pyx_t_4;
4377  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4378  Py_ssize_t __pyx_t_6;
4379  Py_ssize_t __pyx_t_7;
4380  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4381  cDenseMatrix<float> *__pyx_t_9;
4382  int __pyx_lineno = 0;
4383  const char *__pyx_filename = NULL;
4384  int __pyx_clineno = 0;
4385  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4386  __Pyx_RefNannySetupContext("set_dense_matrix_float", 0);
4387  __Pyx_TraceCall("set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4388 
4389  /* "imate/_c_linear_operator/py_c_matrix.pyx":225
4390  *
4391  * # Matrix size
4392  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4393  * cdef LongIndexType A_num_columns = A.shape[1]
4394  *
4395  */
4396  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4397  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4398  __Pyx_GOTREF(__pyx_t_1);
4399  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4400  __Pyx_GOTREF(__pyx_t_2);
4401  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4402  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4403  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4404  __pyx_v_A_num_rows = __pyx_t_3;
4405 
4406  /* "imate/_c_linear_operator/py_c_matrix.pyx":226
4407  * # Matrix size
4408  * cdef LongIndexType A_num_rows = A.shape[0]
4409  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4410  *
4411  * # Contiguity
4412  */
4413  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4414  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4415  __Pyx_GOTREF(__pyx_t_2);
4416  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4417  __Pyx_GOTREF(__pyx_t_1);
4418  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4419  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4421  __pyx_v_A_num_columns = __pyx_t_3;
4422 
4423  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4424  * # Contiguity
4425  * cdef FlagType A_is_row_major
4426  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4427  * A_is_row_major = 1
4428  * elif A.flags['F_CONTIGUOUS']:
4429  */
4430  __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4431  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4432  __Pyx_GOTREF(__pyx_t_1);
4433  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4434  __Pyx_GOTREF(__pyx_t_2);
4435  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4437  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4438  if (__pyx_t_4) {
4439 
4440  /* "imate/_c_linear_operator/py_c_matrix.pyx":231
4441  * cdef FlagType A_is_row_major
4442  * if A.flags['C_CONTIGUOUS']:
4443  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4444  * elif A.flags['F_CONTIGUOUS']:
4445  * A_is_row_major = 0
4446  */
4447  __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4448  __pyx_v_A_is_row_major = 1;
4449 
4450  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4451  * # Contiguity
4452  * cdef FlagType A_is_row_major
4453  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4454  * A_is_row_major = 1
4455  * elif A.flags['F_CONTIGUOUS']:
4456  */
4457  goto __pyx_L3;
4458  }
4459 
4460  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4461  * if A.flags['C_CONTIGUOUS']:
4462  * A_is_row_major = 1
4463  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4464  * A_is_row_major = 0
4465  * else:
4466  */
4467  __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4468  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4469  __Pyx_GOTREF(__pyx_t_2);
4470  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4471  __Pyx_GOTREF(__pyx_t_1);
4472  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4473  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4474  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4475  if (likely(__pyx_t_4)) {
4476 
4477  /* "imate/_c_linear_operator/py_c_matrix.pyx":233
4478  * A_is_row_major = 1
4479  * elif A.flags['F_CONTIGUOUS']:
4480  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4481  * else:
4482  * raise TypeError('Matrix A should be either C or F contiguous.')
4483  */
4484  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4485  __pyx_v_A_is_row_major = 0;
4486 
4487  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4488  * if A.flags['C_CONTIGUOUS']:
4489  * A_is_row_major = 1
4490  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4491  * A_is_row_major = 0
4492  * else:
4493  */
4494  goto __pyx_L3;
4495  }
4496 
4497  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
4498  * A_is_row_major = 0
4499  * else:
4500  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4501  *
4502  * # Declare memoryviews to get data pointer
4503  */
4504  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4505  /*else*/ {
4506  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4507  __Pyx_GOTREF(__pyx_t_1);
4508  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4509  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4510  __PYX_ERR(0, 235, __pyx_L1_error)
4511  }
4512  __pyx_L3:;
4513 
4514  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4515  *
4516  * # Get pointer to data of A depending on row or column major
4517  * if A_is_row_major: # <<<<<<<<<<<<<<
4518  *
4519  * # Memoryview of A for row major matrix
4520  */
4521  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4522  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4523  if (__pyx_t_4) {
4524 
4525  /* "imate/_c_linear_operator/py_c_matrix.pyx":248
4526  *
4527  * # Memoryview of A for row major matrix
4528  * A_data_float_mv_c = A # <<<<<<<<<<<<<<
4529  *
4530  * # Pointer of the data of A
4531  */
4532  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4533  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4534  __pyx_v_A_data_float_mv_c = __pyx_t_5;
4535  __pyx_t_5.memview = NULL;
4536  __pyx_t_5.data = NULL;
4537 
4538  /* "imate/_c_linear_operator/py_c_matrix.pyx":251
4539  *
4540  * # Pointer of the data of A
4541  * A_data_float = &A_data_float_mv_c[0, 0] # <<<<<<<<<<<<<<
4542  *
4543  * else:
4544  */
4545  __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4546  __pyx_t_6 = 0;
4547  __pyx_t_7 = 0;
4548  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4549 
4550  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4551  *
4552  * # Get pointer to data of A depending on row or column major
4553  * if A_is_row_major: # <<<<<<<<<<<<<<
4554  *
4555  * # Memoryview of A for row major matrix
4556  */
4557  goto __pyx_L4;
4558  }
4559 
4560  /* "imate/_c_linear_operator/py_c_matrix.pyx":256
4561  *
4562  * # Memoryview of A for column major matrix
4563  * A_data_float_mv_f = A # <<<<<<<<<<<<<<
4564  *
4565  * # Pointer of the data of A
4566  */
4567  __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4568  /*else*/ {
4569  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4570  __pyx_v_A_data_float_mv_f = __pyx_t_8;
4571  __pyx_t_8.memview = NULL;
4572  __pyx_t_8.data = NULL;
4573 
4574  /* "imate/_c_linear_operator/py_c_matrix.pyx":259
4575  *
4576  * # Pointer of the data of A
4577  * A_data_float = &A_data_float_mv_f[0, 0] # <<<<<<<<<<<<<<
4578  *
4579  * # Create a linear operator object
4580  */
4581  __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4582  __pyx_t_7 = 0;
4583  __pyx_t_6 = 0;
4584  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4585  }
4586  __pyx_L4:;
4587 
4588  /* "imate/_c_linear_operator/py_c_matrix.pyx":262
4589  *
4590  * # Create a linear operator object
4591  * self.Aop_float = new cDenseMatrix[float]( # <<<<<<<<<<<<<<
4592  * A_data_float,
4593  * A_num_rows,
4594  */
4595  __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4596  try {
4597  __pyx_t_9 = new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4598  } catch(...) {
4599  __Pyx_CppExn2PyErr();
4600  __PYX_ERR(0, 262, __pyx_L1_error)
4601  }
4602  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4603 
4604  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4605  * # ======================
4606  *
4607  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4608  * """
4609  * Sets matrix A.
4610  */
4611 
4612  /* function exit code */
4613  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4614  goto __pyx_L0;
4615  __pyx_L1_error:;
4616  __Pyx_XDECREF(__pyx_t_1);
4617  __Pyx_XDECREF(__pyx_t_2);
4618  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4619  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4620  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4621  __pyx_r = NULL;
4622  __pyx_L0:;
4623  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4624  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4625  __Pyx_XGIVEREF(__pyx_r);
4626  __Pyx_TraceReturn(__pyx_r, 0);
4627  __Pyx_RefNannyFinishContext();
4628  return __pyx_r;
4629 }
4630 
4631 /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4632  * # =======================
4633  *
4634  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4635  * """
4636  * Sets matrix A.
4637  */
4638 
4639 /* Python wrapper */
4640 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4641 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] = "pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4642 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4643 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4644  PyObject *__pyx_r = 0;
4645  __Pyx_RefNannyDeclarations
4646  __Pyx_RefNannySetupContext("set_dense_matrix_double (wrapper)", 0);
4647  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4648 
4649  /* function exit code */
4650  __Pyx_RefNannyFinishContext();
4651  return __pyx_r;
4652 }
4653 
4654 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4655  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4656  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4657  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4658  __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4659  __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4660  double *__pyx_v_A_data_double;
4661  PyObject *__pyx_r = NULL;
4662  __Pyx_TraceDeclarations
4663  __Pyx_RefNannyDeclarations
4664  PyObject *__pyx_t_1 = NULL;
4665  PyObject *__pyx_t_2 = NULL;
4666  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4667  int __pyx_t_4;
4668  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4669  Py_ssize_t __pyx_t_6;
4670  Py_ssize_t __pyx_t_7;
4671  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4672  cDenseMatrix<double> *__pyx_t_9;
4673  int __pyx_lineno = 0;
4674  const char *__pyx_filename = NULL;
4675  int __pyx_clineno = 0;
4676  __Pyx_TraceFrameInit(__pyx_codeobj__6)
4677  __Pyx_RefNannySetupContext("set_dense_matrix_double", 0);
4678  __Pyx_TraceCall("set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4679 
4680  /* "imate/_c_linear_operator/py_c_matrix.pyx":281
4681  *
4682  * # Matrix size
4683  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4684  * cdef LongIndexType A_num_columns = A.shape[1]
4685  *
4686  */
4687  __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4688  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4689  __Pyx_GOTREF(__pyx_t_1);
4690  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4691  __Pyx_GOTREF(__pyx_t_2);
4692  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4693  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4694  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4695  __pyx_v_A_num_rows = __pyx_t_3;
4696 
4697  /* "imate/_c_linear_operator/py_c_matrix.pyx":282
4698  * # Matrix size
4699  * cdef LongIndexType A_num_rows = A.shape[0]
4700  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4701  *
4702  * # Contiguity
4703  */
4704  __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4705  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4706  __Pyx_GOTREF(__pyx_t_2);
4707  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4708  __Pyx_GOTREF(__pyx_t_1);
4709  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4710  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4711  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4712  __pyx_v_A_num_columns = __pyx_t_3;
4713 
4714  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4715  * # Contiguity
4716  * cdef FlagType A_is_row_major
4717  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4718  * A_is_row_major = 1
4719  * elif A.flags['F_CONTIGUOUS']:
4720  */
4721  __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4722  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4723  __Pyx_GOTREF(__pyx_t_1);
4724  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4725  __Pyx_GOTREF(__pyx_t_2);
4726  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4727  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4728  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4729  if (__pyx_t_4) {
4730 
4731  /* "imate/_c_linear_operator/py_c_matrix.pyx":287
4732  * cdef FlagType A_is_row_major
4733  * if A.flags['C_CONTIGUOUS']:
4734  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4735  * elif A.flags['F_CONTIGUOUS']:
4736  * A_is_row_major = 0
4737  */
4738  __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4739  __pyx_v_A_is_row_major = 1;
4740 
4741  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4742  * # Contiguity
4743  * cdef FlagType A_is_row_major
4744  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4745  * A_is_row_major = 1
4746  * elif A.flags['F_CONTIGUOUS']:
4747  */
4748  goto __pyx_L3;
4749  }
4750 
4751  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4752  * if A.flags['C_CONTIGUOUS']:
4753  * A_is_row_major = 1
4754  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4755  * A_is_row_major = 0
4756  * else:
4757  */
4758  __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4759  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4760  __Pyx_GOTREF(__pyx_t_2);
4761  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4762  __Pyx_GOTREF(__pyx_t_1);
4763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4764  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4765  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4766  if (likely(__pyx_t_4)) {
4767 
4768  /* "imate/_c_linear_operator/py_c_matrix.pyx":289
4769  * A_is_row_major = 1
4770  * elif A.flags['F_CONTIGUOUS']:
4771  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4772  * else:
4773  * raise TypeError('Matrix A should be either C or F contiguous.')
4774  */
4775  __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4776  __pyx_v_A_is_row_major = 0;
4777 
4778  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4779  * if A.flags['C_CONTIGUOUS']:
4780  * A_is_row_major = 1
4781  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4782  * A_is_row_major = 0
4783  * else:
4784  */
4785  goto __pyx_L3;
4786  }
4787 
4788  /* "imate/_c_linear_operator/py_c_matrix.pyx":291
4789  * A_is_row_major = 0
4790  * else:
4791  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4792  *
4793  * # Declare memoryviews to get data pointer
4794  */
4795  __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4796  /*else*/ {
4797  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4798  __Pyx_GOTREF(__pyx_t_1);
4799  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4800  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4801  __PYX_ERR(0, 291, __pyx_L1_error)
4802  }
4803  __pyx_L3:;
4804 
4805  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4806  *
4807  * # Get pointer to data of A depending on row or column major
4808  * if A_is_row_major: # <<<<<<<<<<<<<<
4809  *
4810  * # Memoryview of A for row major matrix
4811  */
4812  __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4813  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4814  if (__pyx_t_4) {
4815 
4816  /* "imate/_c_linear_operator/py_c_matrix.pyx":304
4817  *
4818  * # Memoryview of A for row major matrix
4819  * A_data_double_mv_c = A # <<<<<<<<<<<<<<
4820  *
4821  * # Pointer of the data of A
4822  */
4823  __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4824  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4825  __pyx_v_A_data_double_mv_c = __pyx_t_5;
4826  __pyx_t_5.memview = NULL;
4827  __pyx_t_5.data = NULL;
4828 
4829  /* "imate/_c_linear_operator/py_c_matrix.pyx":307
4830  *
4831  * # Pointer of the data of A
4832  * A_data_double = &A_data_double_mv_c[0, 0] # <<<<<<<<<<<<<<
4833  *
4834  * else:
4835  */
4836  __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4837  __pyx_t_6 = 0;
4838  __pyx_t_7 = 0;
4839  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4840 
4841  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4842  *
4843  * # Get pointer to data of A depending on row or column major
4844  * if A_is_row_major: # <<<<<<<<<<<<<<
4845  *
4846  * # Memoryview of A for row major matrix
4847  */
4848  goto __pyx_L4;
4849  }
4850 
4851  /* "imate/_c_linear_operator/py_c_matrix.pyx":312
4852  *
4853  * # Memoryview of A for column major matrix
4854  * A_data_double_mv_f = A # <<<<<<<<<<<<<<
4855  *
4856  * # Pointer of the data of A
4857  */
4858  __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4859  /*else*/ {
4860  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4861  __pyx_v_A_data_double_mv_f = __pyx_t_8;
4862  __pyx_t_8.memview = NULL;
4863  __pyx_t_8.data = NULL;
4864 
4865  /* "imate/_c_linear_operator/py_c_matrix.pyx":315
4866  *
4867  * # Pointer of the data of A
4868  * A_data_double = &A_data_double_mv_f[0, 0] # <<<<<<<<<<<<<<
4869  *
4870  * # Create a linear operator object
4871  */
4872  __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4873  __pyx_t_7 = 0;
4874  __pyx_t_6 = 0;
4875  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4876  }
4877  __pyx_L4:;
4878 
4879  /* "imate/_c_linear_operator/py_c_matrix.pyx":318
4880  *
4881  * # Create a linear operator object
4882  * self.Aop_double = new cDenseMatrix[double]( # <<<<<<<<<<<<<<
4883  * A_data_double,
4884  * A_num_rows,
4885  */
4886  __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4887  try {
4888  __pyx_t_9 = new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4889  } catch(...) {
4890  __Pyx_CppExn2PyErr();
4891  __PYX_ERR(0, 318, __pyx_L1_error)
4892  }
4893  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4894 
4895  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4896  * # =======================
4897  *
4898  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4899  * """
4900  * Sets matrix A.
4901  */
4902 
4903  /* function exit code */
4904  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4905  goto __pyx_L0;
4906  __pyx_L1_error:;
4907  __Pyx_XDECREF(__pyx_t_1);
4908  __Pyx_XDECREF(__pyx_t_2);
4909  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4910  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4911  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4912  __pyx_r = NULL;
4913  __pyx_L0:;
4914  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4915  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4916  __Pyx_XGIVEREF(__pyx_r);
4917  __Pyx_TraceReturn(__pyx_r, 0);
4918  __Pyx_RefNannyFinishContext();
4919  return __pyx_r;
4920 }
4921 
4922 /* "imate/_c_linear_operator/py_c_matrix.pyx":328
4923  * # ============================
4924  *
4925  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
4926  * """
4927  * Sets matrix A.
4928  */
4929 
4930 /* Python wrapper */
4931 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4932 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] = "pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4933 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4934 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4935  PyObject *__pyx_r = 0;
4936  __Pyx_RefNannyDeclarations
4937  __Pyx_RefNannySetupContext("set_dense_matrix_long_double (wrapper)", 0);
4938  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4939 
4940  /* function exit code */
4941  __Pyx_RefNannyFinishContext();
4942  return __pyx_r;
4943 }
4944 
4945 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4946  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4947  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4948  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4949  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4950  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4951  long double *__pyx_v_A_data_long_double;
4952  PyObject *__pyx_r = NULL;
4953  __Pyx_TraceDeclarations
4954  __Pyx_RefNannyDeclarations
4955  PyObject *__pyx_t_1 = NULL;
4956  PyObject *__pyx_t_2 = NULL;
4957  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4958  int __pyx_t_4;
4959  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4960  Py_ssize_t __pyx_t_6;
4961  Py_ssize_t __pyx_t_7;
4962  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4963  cDenseMatrix<long double> *__pyx_t_9;
4964  int __pyx_lineno = 0;
4965  const char *__pyx_filename = NULL;
4966  int __pyx_clineno = 0;
4967  __Pyx_TraceFrameInit(__pyx_codeobj__7)
4968  __Pyx_RefNannySetupContext("set_dense_matrix_long_double", 0);
4969  __Pyx_TraceCall("set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4970 
4971  /* "imate/_c_linear_operator/py_c_matrix.pyx":337
4972  *
4973  * # Matrix size
4974  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4975  * cdef LongIndexType A_num_columns = A.shape[1]
4976  *
4977  */
4978  __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4979  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4980  __Pyx_GOTREF(__pyx_t_1);
4981  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4982  __Pyx_GOTREF(__pyx_t_2);
4983  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4984  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4985  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4986  __pyx_v_A_num_rows = __pyx_t_3;
4987 
4988  /* "imate/_c_linear_operator/py_c_matrix.pyx":338
4989  * # Matrix size
4990  * cdef LongIndexType A_num_rows = A.shape[0]
4991  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4992  *
4993  * # Contiguity
4994  */
4995  __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4996  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4997  __Pyx_GOTREF(__pyx_t_2);
4998  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4999  __Pyx_GOTREF(__pyx_t_1);
5000  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5001  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
5002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5003  __pyx_v_A_num_columns = __pyx_t_3;
5004 
5005  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
5006  * # Contiguity
5007  * cdef FlagType A_is_row_major
5008  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5009  * A_is_row_major = 1
5010  * elif A.flags['F_CONTIGUOUS']:
5011  */
5012  __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
5013  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
5014  __Pyx_GOTREF(__pyx_t_1);
5015  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5016  __Pyx_GOTREF(__pyx_t_2);
5017  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5018  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
5019  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5020  if (__pyx_t_4) {
5021 
5022  /* "imate/_c_linear_operator/py_c_matrix.pyx":343
5023  * cdef FlagType A_is_row_major
5024  * if A.flags['C_CONTIGUOUS']:
5025  * A_is_row_major = 1 # <<<<<<<<<<<<<<
5026  * elif A.flags['F_CONTIGUOUS']:
5027  * A_is_row_major = 0
5028  */
5029  __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
5030  __pyx_v_A_is_row_major = 1;
5031 
5032  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
5033  * # Contiguity
5034  * cdef FlagType A_is_row_major
5035  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5036  * A_is_row_major = 1
5037  * elif A.flags['F_CONTIGUOUS']:
5038  */
5039  goto __pyx_L3;
5040  }
5041 
5042  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
5043  * if A.flags['C_CONTIGUOUS']:
5044  * A_is_row_major = 1
5045  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5046  * A_is_row_major = 0
5047  * else:
5048  */
5049  __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
5050  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
5051  __Pyx_GOTREF(__pyx_t_2);
5052  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
5053  __Pyx_GOTREF(__pyx_t_1);
5054  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5055  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
5056  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5057  if (likely(__pyx_t_4)) {
5058 
5059  /* "imate/_c_linear_operator/py_c_matrix.pyx":345
5060  * A_is_row_major = 1
5061  * elif A.flags['F_CONTIGUOUS']:
5062  * A_is_row_major = 0 # <<<<<<<<<<<<<<
5063  * else:
5064  * raise TypeError('Matrix A should be either C or F contiguous.')
5065  */
5066  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5067  __pyx_v_A_is_row_major = 0;
5068 
5069  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
5070  * if A.flags['C_CONTIGUOUS']:
5071  * A_is_row_major = 1
5072  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5073  * A_is_row_major = 0
5074  * else:
5075  */
5076  goto __pyx_L3;
5077  }
5078 
5079  /* "imate/_c_linear_operator/py_c_matrix.pyx":347
5080  * A_is_row_major = 0
5081  * else:
5082  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
5083  *
5084  * # Declare memoryviews to get data pointer
5085  */
5086  __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
5087  /*else*/ {
5088  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5089  __Pyx_GOTREF(__pyx_t_1);
5090  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5091  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5092  __PYX_ERR(0, 347, __pyx_L1_error)
5093  }
5094  __pyx_L3:;
5095 
5096  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
5097  *
5098  * # Get pointer to data of A depending on row or column major
5099  * if A_is_row_major: # <<<<<<<<<<<<<<
5100  *
5101  * # Memoryview of A for row major matrix
5102  */
5103  __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
5104  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
5105  if (__pyx_t_4) {
5106 
5107  /* "imate/_c_linear_operator/py_c_matrix.pyx":360
5108  *
5109  * # Memoryview of A for row major matrix
5110  * A_data_long_double_mv_c = A # <<<<<<<<<<<<<<
5111  *
5112  * # Pointer of the data of A
5113  */
5114  __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
5115  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
5116  __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
5117  __pyx_t_5.memview = NULL;
5118  __pyx_t_5.data = NULL;
5119 
5120  /* "imate/_c_linear_operator/py_c_matrix.pyx":363
5121  *
5122  * # Pointer of the data of A
5123  * A_data_long_double = &A_data_long_double_mv_c[0, 0] # <<<<<<<<<<<<<<
5124  *
5125  * else:
5126  */
5127  __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
5128  __pyx_t_6 = 0;
5129  __pyx_t_7 = 0;
5130  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
5131 
5132  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
5133  *
5134  * # Get pointer to data of A depending on row or column major
5135  * if A_is_row_major: # <<<<<<<<<<<<<<
5136  *
5137  * # Memoryview of A for row major matrix
5138  */
5139  goto __pyx_L4;
5140  }
5141 
5142  /* "imate/_c_linear_operator/py_c_matrix.pyx":368
5143  *
5144  * # Memoryview of A for column major matrix
5145  * A_data_long_double_mv_f = A # <<<<<<<<<<<<<<
5146  *
5147  * # Pointer of the data of A
5148  */
5149  __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
5150  /*else*/ {
5151  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
5152  __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
5153  __pyx_t_8.memview = NULL;
5154  __pyx_t_8.data = NULL;
5155 
5156  /* "imate/_c_linear_operator/py_c_matrix.pyx":371
5157  *
5158  * # Pointer of the data of A
5159  * A_data_long_double = &A_data_long_double_mv_f[0, 0] # <<<<<<<<<<<<<<
5160  *
5161  * # Create a linear operator object
5162  */
5163  __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
5164  __pyx_t_7 = 0;
5165  __pyx_t_6 = 0;
5166  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
5167  }
5168  __pyx_L4:;
5169 
5170  /* "imate/_c_linear_operator/py_c_matrix.pyx":374
5171  *
5172  * # Create a linear operator object
5173  * self.Aop_long_double = new cDenseMatrix[long double]( # <<<<<<<<<<<<<<
5174  * A_data_long_double,
5175  * A_num_rows,
5176  */
5177  __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
5178  try {
5179  __pyx_t_9 = new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
5180  } catch(...) {
5181  __Pyx_CppExn2PyErr();
5182  __PYX_ERR(0, 374, __pyx_L1_error)
5183  }
5184  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5185 
5186  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
5187  * # ============================
5188  *
5189  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5190  * """
5191  * Sets matrix A.
5192  */
5193 
5194  /* function exit code */
5195  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5196  goto __pyx_L0;
5197  __pyx_L1_error:;
5198  __Pyx_XDECREF(__pyx_t_1);
5199  __Pyx_XDECREF(__pyx_t_2);
5200  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5201  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5202  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5203  __pyx_r = NULL;
5204  __pyx_L0:;
5205  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
5206  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
5207  __Pyx_XGIVEREF(__pyx_r);
5208  __Pyx_TraceReturn(__pyx_r, 0);
5209  __Pyx_RefNannyFinishContext();
5210  return __pyx_r;
5211 }
5212 
5213 /* "imate/_c_linear_operator/py_c_matrix.pyx":384
5214  * # ====================
5215  *
5216  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
5217  * """
5218  * """
5219  */
5220 
5221 /* Python wrapper */
5222 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5223 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float(self, A)\n\n ";
5224 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
5225 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5226  PyObject *__pyx_r = 0;
5227  __Pyx_RefNannyDeclarations
5228  __Pyx_RefNannySetupContext("set_csr_matrix_float (wrapper)", 0);
5229  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5230 
5231  /* function exit code */
5232  __Pyx_RefNannyFinishContext();
5233  return __pyx_r;
5234 }
5235 
5236 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5237  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5238  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5239  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5240  float *__pyx_v_A_data_float;
5241  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5242  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5243  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5244  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5245  PyObject *__pyx_r = NULL;
5246  __Pyx_TraceDeclarations
5247  __Pyx_RefNannyDeclarations
5248  PyObject *__pyx_t_1 = NULL;
5249  PyObject *__pyx_t_2 = NULL;
5250  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5251  PyObject *__pyx_t_4 = NULL;
5252  PyObject *__pyx_t_5 = NULL;
5253  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5254  Py_ssize_t __pyx_t_7;
5255  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5256  cCSRMatrix<float> *__pyx_t_9;
5257  int __pyx_lineno = 0;
5258  const char *__pyx_filename = NULL;
5259  int __pyx_clineno = 0;
5260  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5261  __Pyx_RefNannySetupContext("set_csr_matrix_float", 0);
5262  __Pyx_TraceCall("set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
5263 
5264  /* "imate/_c_linear_operator/py_c_matrix.pyx":389
5265  *
5266  * # Matrix size
5267  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5268  * cdef LongIndexType A_num_columns = A.shape[1]
5269  *
5270  */
5271  __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5272  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
5273  __Pyx_GOTREF(__pyx_t_1);
5274  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
5275  __Pyx_GOTREF(__pyx_t_2);
5276  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
5278  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5279  __pyx_v_A_num_rows = __pyx_t_3;
5280 
5281  /* "imate/_c_linear_operator/py_c_matrix.pyx":390
5282  * # Matrix size
5283  * cdef LongIndexType A_num_rows = A.shape[0]
5284  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5285  *
5286  * # Declare memoryviews to get pointer of A.data
5287  */
5288  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5289  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
5290  __Pyx_GOTREF(__pyx_t_2);
5291  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
5292  __Pyx_GOTREF(__pyx_t_1);
5293  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5294  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
5295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5296  __pyx_v_A_num_columns = __pyx_t_3;
5297 
5298  /* "imate/_c_linear_operator/py_c_matrix.pyx":400
5299  * # If the input type is the same as LongIndexType, no copy is performed.
5300  * self.A_indices_copy = \
5301  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5302  * self.A_index_pointer_copy = \
5303  * A.indptr.astype(self.long_index_type_name, copy=False)
5304  */
5305  __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5306  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5307  __Pyx_GOTREF(__pyx_t_1);
5308  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5309  __Pyx_GOTREF(__pyx_t_2);
5310  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5311  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5312  __Pyx_GOTREF(__pyx_t_1);
5313  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5314  __Pyx_GOTREF(__pyx_t_4);
5315  __Pyx_GIVEREF(__pyx_t_1);
5316  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5317  __pyx_t_1 = 0;
5318  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5319  __Pyx_GOTREF(__pyx_t_1);
5320  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5321  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5322  __Pyx_GOTREF(__pyx_t_5);
5323  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5324  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5325  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5326 
5327  /* "imate/_c_linear_operator/py_c_matrix.pyx":399
5328  *
5329  * # If the input type is the same as LongIndexType, no copy is performed.
5330  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5331  * A.indices.astype(self.long_index_type_name, copy=False)
5332  * self.A_index_pointer_copy = \
5333  */
5334  __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5335  __Pyx_GIVEREF(__pyx_t_5);
5336  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5337  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5338  __pyx_v_self->A_indices_copy = __pyx_t_5;
5339  __pyx_t_5 = 0;
5340 
5341  /* "imate/_c_linear_operator/py_c_matrix.pyx":402
5342  * A.indices.astype(self.long_index_type_name, copy=False)
5343  * self.A_index_pointer_copy = \
5344  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5345  *
5346  * # Declare memoryviews to get pointer of A.indices and A.indptr
5347  */
5348  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5349  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5350  __Pyx_GOTREF(__pyx_t_5);
5351  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5352  __Pyx_GOTREF(__pyx_t_1);
5353  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5354  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5355  __Pyx_GOTREF(__pyx_t_5);
5356  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5357  __Pyx_GOTREF(__pyx_t_4);
5358  __Pyx_GIVEREF(__pyx_t_5);
5359  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5360  __pyx_t_5 = 0;
5361  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5362  __Pyx_GOTREF(__pyx_t_5);
5363  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5364  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5365  __Pyx_GOTREF(__pyx_t_2);
5366  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5367  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5368  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5369 
5370  /* "imate/_c_linear_operator/py_c_matrix.pyx":401
5371  * self.A_indices_copy = \
5372  * A.indices.astype(self.long_index_type_name, copy=False)
5373  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5374  * A.indptr.astype(self.long_index_type_name, copy=False)
5375  *
5376  */
5377  __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5378  __Pyx_GIVEREF(__pyx_t_2);
5379  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5380  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5381  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5382  __pyx_t_2 = 0;
5383 
5384  /* "imate/_c_linear_operator/py_c_matrix.pyx":405
5385  *
5386  * # Declare memoryviews to get pointer of A.indices and A.indptr
5387  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5388  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5389  * self.A_index_pointer_copy
5390  */
5391  __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5392  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5393  __pyx_v_A_indices_mv = __pyx_t_6;
5394  __pyx_t_6.memview = NULL;
5395  __pyx_t_6.data = NULL;
5396 
5397  /* "imate/_c_linear_operator/py_c_matrix.pyx":407
5398  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5399  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5400  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5401  *
5402  * # Declare pointers to A.indices ans A.indptr
5403  */
5404  __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5405  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5406  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5407  __pyx_t_6.memview = NULL;
5408  __pyx_t_6.data = NULL;
5409 
5410  /* "imate/_c_linear_operator/py_c_matrix.pyx":410
5411  *
5412  * # Declare pointers to A.indices ans A.indptr
5413  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5414  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5415  *
5416  */
5417  __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5418  __pyx_t_7 = 0;
5419  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5420 
5421  /* "imate/_c_linear_operator/py_c_matrix.pyx":411
5422  * # Declare pointers to A.indices ans A.indptr
5423  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5424  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5425  *
5426  * # Memoryview of A data
5427  */
5428  __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5429  __pyx_t_7 = 0;
5430  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5431 
5432  /* "imate/_c_linear_operator/py_c_matrix.pyx":414
5433  *
5434  * # Memoryview of A data
5435  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
5436  *
5437  * # Get pointers
5438  */
5439  __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5440  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5441  __Pyx_GOTREF(__pyx_t_2);
5442  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5443  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5444  __pyx_v_A_data_float_mv = __pyx_t_8;
5445  __pyx_t_8.memview = NULL;
5446  __pyx_t_8.data = NULL;
5447 
5448  /* "imate/_c_linear_operator/py_c_matrix.pyx":417
5449  *
5450  * # Get pointers
5451  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
5452  *
5453  * # Create a linear operator object
5454  */
5455  __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5456  __pyx_t_7 = 0;
5457  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5458 
5459  /* "imate/_c_linear_operator/py_c_matrix.pyx":420
5460  *
5461  * # Create a linear operator object
5462  * self.Aop_float = new cCSRMatrix[float]( # <<<<<<<<<<<<<<
5463  * A_data_float,
5464  * A_indices,
5465  */
5466  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5467  try {
5468  __pyx_t_9 = new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5469  } catch(...) {
5470  __Pyx_CppExn2PyErr();
5471  __PYX_ERR(0, 420, __pyx_L1_error)
5472  }
5473  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5474 
5475  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
5476  * # ====================
5477  *
5478  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
5479  * """
5480  * """
5481  */
5482 
5483  /* function exit code */
5484  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5485  goto __pyx_L0;
5486  __pyx_L1_error:;
5487  __Pyx_XDECREF(__pyx_t_1);
5488  __Pyx_XDECREF(__pyx_t_2);
5489  __Pyx_XDECREF(__pyx_t_4);
5490  __Pyx_XDECREF(__pyx_t_5);
5491  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5492  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5493  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5494  __pyx_r = NULL;
5495  __pyx_L0:;
5496  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5497  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5498  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5499  __Pyx_XGIVEREF(__pyx_r);
5500  __Pyx_TraceReturn(__pyx_r, 0);
5501  __Pyx_RefNannyFinishContext();
5502  return __pyx_r;
5503 }
5504 
5505 /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5506  * # =====================
5507  *
5508  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5509  * """
5510  * """
5511  */
5512 
5513 /* Python wrapper */
5514 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5515 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5516 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5517 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5518  PyObject *__pyx_r = 0;
5519  __Pyx_RefNannyDeclarations
5520  __Pyx_RefNannySetupContext("set_csr_matrix_double (wrapper)", 0);
5521  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5522 
5523  /* function exit code */
5524  __Pyx_RefNannyFinishContext();
5525  return __pyx_r;
5526 }
5527 
5528 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5529  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5530  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5531  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5532  double *__pyx_v_A_data_double;
5533  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5534  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5535  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5536  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5537  PyObject *__pyx_r = NULL;
5538  __Pyx_TraceDeclarations
5539  __Pyx_RefNannyDeclarations
5540  PyObject *__pyx_t_1 = NULL;
5541  PyObject *__pyx_t_2 = NULL;
5542  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5543  PyObject *__pyx_t_4 = NULL;
5544  PyObject *__pyx_t_5 = NULL;
5545  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5546  Py_ssize_t __pyx_t_7;
5547  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5548  cCSRMatrix<double> *__pyx_t_9;
5549  int __pyx_lineno = 0;
5550  const char *__pyx_filename = NULL;
5551  int __pyx_clineno = 0;
5552  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5553  __Pyx_RefNannySetupContext("set_csr_matrix_double", 0);
5554  __Pyx_TraceCall("set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5555 
5556  /* "imate/_c_linear_operator/py_c_matrix.pyx":436
5557  *
5558  * # Matrix size
5559  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5560  * cdef LongIndexType A_num_columns = A.shape[1]
5561  *
5562  */
5563  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5564  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5565  __Pyx_GOTREF(__pyx_t_1);
5566  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5567  __Pyx_GOTREF(__pyx_t_2);
5568  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5569  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5570  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5571  __pyx_v_A_num_rows = __pyx_t_3;
5572 
5573  /* "imate/_c_linear_operator/py_c_matrix.pyx":437
5574  * # Matrix size
5575  * cdef LongIndexType A_num_rows = A.shape[0]
5576  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5577  *
5578  * # Declare memoryviews to get pointer of A.data
5579  */
5580  __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5581  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5582  __Pyx_GOTREF(__pyx_t_2);
5583  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5584  __Pyx_GOTREF(__pyx_t_1);
5585  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5586  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5587  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5588  __pyx_v_A_num_columns = __pyx_t_3;
5589 
5590  /* "imate/_c_linear_operator/py_c_matrix.pyx":447
5591  * # If the input type is the same as LongIndexType, no copy is performed.
5592  * self.A_indices_copy = \
5593  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5594  * self.A_index_pointer_copy = \
5595  * A.indptr.astype(self.long_index_type_name, copy=False)
5596  */
5597  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5598  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5599  __Pyx_GOTREF(__pyx_t_1);
5600  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5601  __Pyx_GOTREF(__pyx_t_2);
5602  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5603  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5604  __Pyx_GOTREF(__pyx_t_1);
5605  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5606  __Pyx_GOTREF(__pyx_t_4);
5607  __Pyx_GIVEREF(__pyx_t_1);
5608  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5609  __pyx_t_1 = 0;
5610  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5611  __Pyx_GOTREF(__pyx_t_1);
5612  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5613  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5614  __Pyx_GOTREF(__pyx_t_5);
5615  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5616  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5617  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5618 
5619  /* "imate/_c_linear_operator/py_c_matrix.pyx":446
5620  *
5621  * # If the input type is the same as LongIndexType, no copy is performed.
5622  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5623  * A.indices.astype(self.long_index_type_name, copy=False)
5624  * self.A_index_pointer_copy = \
5625  */
5626  __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5627  __Pyx_GIVEREF(__pyx_t_5);
5628  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5629  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5630  __pyx_v_self->A_indices_copy = __pyx_t_5;
5631  __pyx_t_5 = 0;
5632 
5633  /* "imate/_c_linear_operator/py_c_matrix.pyx":449
5634  * A.indices.astype(self.long_index_type_name, copy=False)
5635  * self.A_index_pointer_copy = \
5636  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5637  *
5638  * # Declare memoryviews to get pointer of A.indices and A.indptr
5639  */
5640  __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5641  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5642  __Pyx_GOTREF(__pyx_t_5);
5643  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5644  __Pyx_GOTREF(__pyx_t_1);
5645  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5646  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5647  __Pyx_GOTREF(__pyx_t_5);
5648  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5649  __Pyx_GOTREF(__pyx_t_4);
5650  __Pyx_GIVEREF(__pyx_t_5);
5651  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5652  __pyx_t_5 = 0;
5653  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5654  __Pyx_GOTREF(__pyx_t_5);
5655  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5656  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5657  __Pyx_GOTREF(__pyx_t_2);
5658  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5659  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5660  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5661 
5662  /* "imate/_c_linear_operator/py_c_matrix.pyx":448
5663  * self.A_indices_copy = \
5664  * A.indices.astype(self.long_index_type_name, copy=False)
5665  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5666  * A.indptr.astype(self.long_index_type_name, copy=False)
5667  *
5668  */
5669  __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5670  __Pyx_GIVEREF(__pyx_t_2);
5671  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5672  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5673  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5674  __pyx_t_2 = 0;
5675 
5676  /* "imate/_c_linear_operator/py_c_matrix.pyx":452
5677  *
5678  * # Declare memoryviews to get pointer of A.indices and A.indptr
5679  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5680  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5681  * self.A_index_pointer_copy
5682  */
5683  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5684  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5685  __pyx_v_A_indices_mv = __pyx_t_6;
5686  __pyx_t_6.memview = NULL;
5687  __pyx_t_6.data = NULL;
5688 
5689  /* "imate/_c_linear_operator/py_c_matrix.pyx":454
5690  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5691  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5692  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5693  *
5694  * # Declare pointers to A.indices ans A.indptr
5695  */
5696  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5697  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5698  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5699  __pyx_t_6.memview = NULL;
5700  __pyx_t_6.data = NULL;
5701 
5702  /* "imate/_c_linear_operator/py_c_matrix.pyx":457
5703  *
5704  * # Declare pointers to A.indices ans A.indptr
5705  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5706  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5707  *
5708  */
5709  __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5710  __pyx_t_7 = 0;
5711  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5712 
5713  /* "imate/_c_linear_operator/py_c_matrix.pyx":458
5714  * # Declare pointers to A.indices ans A.indptr
5715  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5716  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5717  *
5718  * # Memoryview of A data
5719  */
5720  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5721  __pyx_t_7 = 0;
5722  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5723 
5724  /* "imate/_c_linear_operator/py_c_matrix.pyx":461
5725  *
5726  * # Memoryview of A data
5727  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
5728  *
5729  * # Get pointers
5730  */
5731  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5732  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5733  __Pyx_GOTREF(__pyx_t_2);
5734  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5735  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5736  __pyx_v_A_data_double_mv = __pyx_t_8;
5737  __pyx_t_8.memview = NULL;
5738  __pyx_t_8.data = NULL;
5739 
5740  /* "imate/_c_linear_operator/py_c_matrix.pyx":464
5741  *
5742  * # Get pointers
5743  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
5744  *
5745  * # Create a linear operator object
5746  */
5747  __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5748  __pyx_t_7 = 0;
5749  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5750 
5751  /* "imate/_c_linear_operator/py_c_matrix.pyx":467
5752  *
5753  * # Create a linear operator object
5754  * self.Aop_double = new cCSRMatrix[double]( # <<<<<<<<<<<<<<
5755  * A_data_double,
5756  * A_indices,
5757  */
5758  __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5759  try {
5760  __pyx_t_9 = new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5761  } catch(...) {
5762  __Pyx_CppExn2PyErr();
5763  __PYX_ERR(0, 467, __pyx_L1_error)
5764  }
5765  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5766 
5767  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5768  * # =====================
5769  *
5770  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5771  * """
5772  * """
5773  */
5774 
5775  /* function exit code */
5776  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5777  goto __pyx_L0;
5778  __pyx_L1_error:;
5779  __Pyx_XDECREF(__pyx_t_1);
5780  __Pyx_XDECREF(__pyx_t_2);
5781  __Pyx_XDECREF(__pyx_t_4);
5782  __Pyx_XDECREF(__pyx_t_5);
5783  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5784  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5785  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5786  __pyx_r = NULL;
5787  __pyx_L0:;
5788  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5789  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5790  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5791  __Pyx_XGIVEREF(__pyx_r);
5792  __Pyx_TraceReturn(__pyx_r, 0);
5793  __Pyx_RefNannyFinishContext();
5794  return __pyx_r;
5795 }
5796 
5797 /* "imate/_c_linear_operator/py_c_matrix.pyx":478
5798  * # ==========================
5799  *
5800  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5801  * """
5802  * """
5803  */
5804 
5805 /* Python wrapper */
5806 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5807 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] = "pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5808 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5809 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5810  PyObject *__pyx_r = 0;
5811  __Pyx_RefNannyDeclarations
5812  __Pyx_RefNannySetupContext("set_csr_matrix_long_double (wrapper)", 0);
5813  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5814 
5815  /* function exit code */
5816  __Pyx_RefNannyFinishContext();
5817  return __pyx_r;
5818 }
5819 
5820 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5821  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5822  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5823  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5824  long double *__pyx_v_A_data_long_double;
5825  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5826  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5827  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5828  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5829  PyObject *__pyx_r = NULL;
5830  __Pyx_TraceDeclarations
5831  __Pyx_RefNannyDeclarations
5832  PyObject *__pyx_t_1 = NULL;
5833  PyObject *__pyx_t_2 = NULL;
5834  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5835  PyObject *__pyx_t_4 = NULL;
5836  PyObject *__pyx_t_5 = NULL;
5837  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5838  Py_ssize_t __pyx_t_7;
5839  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5840  cCSRMatrix<long double> *__pyx_t_9;
5841  int __pyx_lineno = 0;
5842  const char *__pyx_filename = NULL;
5843  int __pyx_clineno = 0;
5844  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5845  __Pyx_RefNannySetupContext("set_csr_matrix_long_double", 0);
5846  __Pyx_TraceCall("set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5847 
5848  /* "imate/_c_linear_operator/py_c_matrix.pyx":483
5849  *
5850  * # Matrix size
5851  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5852  * cdef LongIndexType A_num_columns = A.shape[1]
5853  *
5854  */
5855  __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5856  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5857  __Pyx_GOTREF(__pyx_t_1);
5858  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5859  __Pyx_GOTREF(__pyx_t_2);
5860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5861  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5862  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5863  __pyx_v_A_num_rows = __pyx_t_3;
5864 
5865  /* "imate/_c_linear_operator/py_c_matrix.pyx":484
5866  * # Matrix size
5867  * cdef LongIndexType A_num_rows = A.shape[0]
5868  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5869  *
5870  * # Declare memoryviews to get pointer of A.data
5871  */
5872  __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5873  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5874  __Pyx_GOTREF(__pyx_t_2);
5875  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5876  __Pyx_GOTREF(__pyx_t_1);
5877  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5878  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5879  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5880  __pyx_v_A_num_columns = __pyx_t_3;
5881 
5882  /* "imate/_c_linear_operator/py_c_matrix.pyx":494
5883  * # If the input type is the same as LongIndexType, no copy is performed.
5884  * self.A_indices_copy = \
5885  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5886  * self.A_index_pointer_copy = \
5887  * A.indptr.astype(self.long_index_type_name, copy=False)
5888  */
5889  __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5890  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5891  __Pyx_GOTREF(__pyx_t_1);
5892  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5893  __Pyx_GOTREF(__pyx_t_2);
5894  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5895  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5896  __Pyx_GOTREF(__pyx_t_1);
5897  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5898  __Pyx_GOTREF(__pyx_t_4);
5899  __Pyx_GIVEREF(__pyx_t_1);
5900  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5901  __pyx_t_1 = 0;
5902  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5903  __Pyx_GOTREF(__pyx_t_1);
5904  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5905  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5906  __Pyx_GOTREF(__pyx_t_5);
5907  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5908  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5909  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5910 
5911  /* "imate/_c_linear_operator/py_c_matrix.pyx":493
5912  *
5913  * # If the input type is the same as LongIndexType, no copy is performed.
5914  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5915  * A.indices.astype(self.long_index_type_name, copy=False)
5916  * self.A_index_pointer_copy = \
5917  */
5918  __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5919  __Pyx_GIVEREF(__pyx_t_5);
5920  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5921  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5922  __pyx_v_self->A_indices_copy = __pyx_t_5;
5923  __pyx_t_5 = 0;
5924 
5925  /* "imate/_c_linear_operator/py_c_matrix.pyx":496
5926  * A.indices.astype(self.long_index_type_name, copy=False)
5927  * self.A_index_pointer_copy = \
5928  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5929  *
5930  * # Declare memoryviews to get pointer of A.indices and A.indptr
5931  */
5932  __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5933  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5934  __Pyx_GOTREF(__pyx_t_5);
5935  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5936  __Pyx_GOTREF(__pyx_t_1);
5937  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5938  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5939  __Pyx_GOTREF(__pyx_t_5);
5940  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5941  __Pyx_GOTREF(__pyx_t_4);
5942  __Pyx_GIVEREF(__pyx_t_5);
5943  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5944  __pyx_t_5 = 0;
5945  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5946  __Pyx_GOTREF(__pyx_t_5);
5947  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5948  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5949  __Pyx_GOTREF(__pyx_t_2);
5950  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5951  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5952  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5953 
5954  /* "imate/_c_linear_operator/py_c_matrix.pyx":495
5955  * self.A_indices_copy = \
5956  * A.indices.astype(self.long_index_type_name, copy=False)
5957  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5958  * A.indptr.astype(self.long_index_type_name, copy=False)
5959  *
5960  */
5961  __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5962  __Pyx_GIVEREF(__pyx_t_2);
5963  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5964  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5965  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5966  __pyx_t_2 = 0;
5967 
5968  /* "imate/_c_linear_operator/py_c_matrix.pyx":499
5969  *
5970  * # Declare memoryviews to get pointer of A.indices and A.indptr
5971  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5972  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5973  * self.A_index_pointer_copy
5974  */
5975  __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5976  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5977  __pyx_v_A_indices_mv = __pyx_t_6;
5978  __pyx_t_6.memview = NULL;
5979  __pyx_t_6.data = NULL;
5980 
5981  /* "imate/_c_linear_operator/py_c_matrix.pyx":501
5982  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5983  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5984  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5985  *
5986  * # Declare pointers to A.indices ans A.indptr
5987  */
5988  __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5989  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5990  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5991  __pyx_t_6.memview = NULL;
5992  __pyx_t_6.data = NULL;
5993 
5994  /* "imate/_c_linear_operator/py_c_matrix.pyx":504
5995  *
5996  * # Declare pointers to A.indices ans A.indptr
5997  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5998  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5999  *
6000  */
6001  __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
6002  __pyx_t_7 = 0;
6003  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6004 
6005  /* "imate/_c_linear_operator/py_c_matrix.pyx":505
6006  * # Declare pointers to A.indices ans A.indptr
6007  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6008  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6009  *
6010  * # Memoryview of A data
6011  */
6012  __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
6013  __pyx_t_7 = 0;
6014  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6015 
6016  /* "imate/_c_linear_operator/py_c_matrix.pyx":508
6017  *
6018  * # Memoryview of A data
6019  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
6020  *
6021  * # Get pointers
6022  */
6023  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6024  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6025  __Pyx_GOTREF(__pyx_t_2);
6026  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
6027  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6028  __pyx_v_A_data_long_double_mv = __pyx_t_8;
6029  __pyx_t_8.memview = NULL;
6030  __pyx_t_8.data = NULL;
6031 
6032  /* "imate/_c_linear_operator/py_c_matrix.pyx":511
6033  *
6034  * # Get pointers
6035  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
6036  *
6037  * # Create a linear operator object
6038  */
6039  __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
6040  __pyx_t_7 = 0;
6041  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6042 
6043  /* "imate/_c_linear_operator/py_c_matrix.pyx":514
6044  *
6045  * # Create a linear operator object
6046  * self.Aop_long_double = new cCSRMatrix[long double]( # <<<<<<<<<<<<<<
6047  * A_data_long_double,
6048  * A_indices,
6049  */
6050  __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6051  try {
6052  __pyx_t_9 = new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6053  } catch(...) {
6054  __Pyx_CppExn2PyErr();
6055  __PYX_ERR(0, 514, __pyx_L1_error)
6056  }
6057  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6058 
6059  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
6060  * # ==========================
6061  *
6062  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6063  * """
6064  * """
6065  */
6066 
6067  /* function exit code */
6068  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6069  goto __pyx_L0;
6070  __pyx_L1_error:;
6071  __Pyx_XDECREF(__pyx_t_1);
6072  __Pyx_XDECREF(__pyx_t_2);
6073  __Pyx_XDECREF(__pyx_t_4);
6074  __Pyx_XDECREF(__pyx_t_5);
6075  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6076  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6077  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6078  __pyx_r = NULL;
6079  __pyx_L0:;
6080  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6081  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6082  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6083  __Pyx_XGIVEREF(__pyx_r);
6084  __Pyx_TraceReturn(__pyx_r, 0);
6085  __Pyx_RefNannyFinishContext();
6086  return __pyx_r;
6087 }
6088 
6089 /* "imate/_c_linear_operator/py_c_matrix.pyx":525
6090  * # ====================
6091  *
6092  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
6093  * """
6094  * """
6095  */
6096 
6097 /* Python wrapper */
6098 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6099 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float(self, A)\n\n ";
6100 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
6101 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6102  PyObject *__pyx_r = 0;
6103  __Pyx_RefNannyDeclarations
6104  __Pyx_RefNannySetupContext("set_csc_matrix_float (wrapper)", 0);
6105  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6106 
6107  /* function exit code */
6108  __Pyx_RefNannyFinishContext();
6109  return __pyx_r;
6110 }
6111 
6112 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6113  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6114  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6115  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6116  float *__pyx_v_A_data_float;
6117  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6118  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6119  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6120  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6121  PyObject *__pyx_r = NULL;
6122  __Pyx_TraceDeclarations
6123  __Pyx_RefNannyDeclarations
6124  PyObject *__pyx_t_1 = NULL;
6125  PyObject *__pyx_t_2 = NULL;
6126  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6127  PyObject *__pyx_t_4 = NULL;
6128  PyObject *__pyx_t_5 = NULL;
6129  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6130  Py_ssize_t __pyx_t_7;
6131  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6132  cCSCMatrix<float> *__pyx_t_9;
6133  int __pyx_lineno = 0;
6134  const char *__pyx_filename = NULL;
6135  int __pyx_clineno = 0;
6136  __Pyx_TraceFrameInit(__pyx_codeobj__11)
6137  __Pyx_RefNannySetupContext("set_csc_matrix_float", 0);
6138  __Pyx_TraceCall("set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
6139 
6140  /* "imate/_c_linear_operator/py_c_matrix.pyx":530
6141  *
6142  * # Matrix size
6143  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6144  * cdef LongIndexType A_num_columns = A.shape[1]
6145  *
6146  */
6147  __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
6148  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
6149  __Pyx_GOTREF(__pyx_t_1);
6150  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
6151  __Pyx_GOTREF(__pyx_t_2);
6152  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
6154  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6155  __pyx_v_A_num_rows = __pyx_t_3;
6156 
6157  /* "imate/_c_linear_operator/py_c_matrix.pyx":531
6158  * # Matrix size
6159  * cdef LongIndexType A_num_rows = A.shape[0]
6160  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6161  *
6162  * # Declare memoryviews to get pointer of A.data
6163  */
6164  __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
6165  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
6166  __Pyx_GOTREF(__pyx_t_2);
6167  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
6168  __Pyx_GOTREF(__pyx_t_1);
6169  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6170  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
6171  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6172  __pyx_v_A_num_columns = __pyx_t_3;
6173 
6174  /* "imate/_c_linear_operator/py_c_matrix.pyx":541
6175  * # If the input type is the same as LongIndexType, no copy is performed.
6176  * self.A_indices_copy = \
6177  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6178  * self.A_index_pointer_copy = \
6179  * A.indptr.astype(self.long_index_type_name, copy=False)
6180  */
6181  __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
6182  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6183  __Pyx_GOTREF(__pyx_t_1);
6184  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
6185  __Pyx_GOTREF(__pyx_t_2);
6186  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6188  __Pyx_GOTREF(__pyx_t_1);
6189  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
6190  __Pyx_GOTREF(__pyx_t_4);
6191  __Pyx_GIVEREF(__pyx_t_1);
6192  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6193  __pyx_t_1 = 0;
6194  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6195  __Pyx_GOTREF(__pyx_t_1);
6196  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
6197  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
6198  __Pyx_GOTREF(__pyx_t_5);
6199  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6200  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6201  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6202 
6203  /* "imate/_c_linear_operator/py_c_matrix.pyx":540
6204  *
6205  * # If the input type is the same as LongIndexType, no copy is performed.
6206  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6207  * A.indices.astype(self.long_index_type_name, copy=False)
6208  * self.A_index_pointer_copy = \
6209  */
6210  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6211  __Pyx_GIVEREF(__pyx_t_5);
6212  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6213  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6214  __pyx_v_self->A_indices_copy = __pyx_t_5;
6215  __pyx_t_5 = 0;
6216 
6217  /* "imate/_c_linear_operator/py_c_matrix.pyx":543
6218  * A.indices.astype(self.long_index_type_name, copy=False)
6219  * self.A_index_pointer_copy = \
6220  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6221  *
6222  * # Declare memoryviews to get pointer of A.indices and A.indptr
6223  */
6224  __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6225  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6226  __Pyx_GOTREF(__pyx_t_5);
6227  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
6228  __Pyx_GOTREF(__pyx_t_1);
6229  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6230  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6231  __Pyx_GOTREF(__pyx_t_5);
6232  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
6233  __Pyx_GOTREF(__pyx_t_4);
6234  __Pyx_GIVEREF(__pyx_t_5);
6235  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6236  __pyx_t_5 = 0;
6237  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6238  __Pyx_GOTREF(__pyx_t_5);
6239  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
6240  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
6241  __Pyx_GOTREF(__pyx_t_2);
6242  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6243  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6244  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6245 
6246  /* "imate/_c_linear_operator/py_c_matrix.pyx":542
6247  * self.A_indices_copy = \
6248  * A.indices.astype(self.long_index_type_name, copy=False)
6249  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6250  * A.indptr.astype(self.long_index_type_name, copy=False)
6251  *
6252  */
6253  __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
6254  __Pyx_GIVEREF(__pyx_t_2);
6255  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6256  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6257  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6258  __pyx_t_2 = 0;
6259 
6260  /* "imate/_c_linear_operator/py_c_matrix.pyx":546
6261  *
6262  * # Declare memoryviews to get pointer of A.indices and A.indptr
6263  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6264  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6265  * self.A_index_pointer_copy
6266  */
6267  __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6268  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
6269  __pyx_v_A_indices_mv = __pyx_t_6;
6270  __pyx_t_6.memview = NULL;
6271  __pyx_t_6.data = NULL;
6272 
6273  /* "imate/_c_linear_operator/py_c_matrix.pyx":548
6274  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6275  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6276  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6277  *
6278  * # Declare pointers to A.indices ans A.indptr
6279  */
6280  __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
6281  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
6282  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6283  __pyx_t_6.memview = NULL;
6284  __pyx_t_6.data = NULL;
6285 
6286  /* "imate/_c_linear_operator/py_c_matrix.pyx":551
6287  *
6288  * # Declare pointers to A.indices ans A.indptr
6289  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6290  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6291  *
6292  */
6293  __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6294  __pyx_t_7 = 0;
6295  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6296 
6297  /* "imate/_c_linear_operator/py_c_matrix.pyx":552
6298  * # Declare pointers to A.indices ans A.indptr
6299  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6300  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6301  *
6302  * # Memoryview of A data
6303  */
6304  __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
6305  __pyx_t_7 = 0;
6306  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6307 
6308  /* "imate/_c_linear_operator/py_c_matrix.pyx":555
6309  *
6310  * # Memoryview of A data
6311  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
6312  *
6313  * # Get pointers
6314  */
6315  __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6316  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6317  __Pyx_GOTREF(__pyx_t_2);
6318  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6319  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6320  __pyx_v_A_data_float_mv = __pyx_t_8;
6321  __pyx_t_8.memview = NULL;
6322  __pyx_t_8.data = NULL;
6323 
6324  /* "imate/_c_linear_operator/py_c_matrix.pyx":558
6325  *
6326  * # Get pointers
6327  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
6328  *
6329  * # Create a linear operator object
6330  */
6331  __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6332  __pyx_t_7 = 0;
6333  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6334 
6335  /* "imate/_c_linear_operator/py_c_matrix.pyx":561
6336  *
6337  * # Create a linear operator object
6338  * self.Aop_float = new cCSCMatrix[float]( # <<<<<<<<<<<<<<
6339  * A_data_float,
6340  * A_indices,
6341  */
6342  __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6343  try {
6344  __pyx_t_9 = new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6345  } catch(...) {
6346  __Pyx_CppExn2PyErr();
6347  __PYX_ERR(0, 561, __pyx_L1_error)
6348  }
6349  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6350 
6351  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
6352  * # ====================
6353  *
6354  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
6355  * """
6356  * """
6357  */
6358 
6359  /* function exit code */
6360  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6361  goto __pyx_L0;
6362  __pyx_L1_error:;
6363  __Pyx_XDECREF(__pyx_t_1);
6364  __Pyx_XDECREF(__pyx_t_2);
6365  __Pyx_XDECREF(__pyx_t_4);
6366  __Pyx_XDECREF(__pyx_t_5);
6367  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6368  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6369  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6370  __pyx_r = NULL;
6371  __pyx_L0:;
6372  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6373  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6374  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6375  __Pyx_XGIVEREF(__pyx_r);
6376  __Pyx_TraceReturn(__pyx_r, 0);
6377  __Pyx_RefNannyFinishContext();
6378  return __pyx_r;
6379 }
6380 
6381 /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6382  * # =====================
6383  *
6384  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6385  * """
6386  * """
6387  */
6388 
6389 /* Python wrapper */
6390 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6391 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6392 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6393 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6394  PyObject *__pyx_r = 0;
6395  __Pyx_RefNannyDeclarations
6396  __Pyx_RefNannySetupContext("set_csc_matrix_double (wrapper)", 0);
6397  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6398 
6399  /* function exit code */
6400  __Pyx_RefNannyFinishContext();
6401  return __pyx_r;
6402 }
6403 
6404 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6405  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6406  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6407  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6408  double *__pyx_v_A_data_double;
6409  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6410  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6411  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6412  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6413  PyObject *__pyx_r = NULL;
6414  __Pyx_TraceDeclarations
6415  __Pyx_RefNannyDeclarations
6416  PyObject *__pyx_t_1 = NULL;
6417  PyObject *__pyx_t_2 = NULL;
6418  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6419  PyObject *__pyx_t_4 = NULL;
6420  PyObject *__pyx_t_5 = NULL;
6421  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6422  Py_ssize_t __pyx_t_7;
6423  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6424  cCSCMatrix<double> *__pyx_t_9;
6425  int __pyx_lineno = 0;
6426  const char *__pyx_filename = NULL;
6427  int __pyx_clineno = 0;
6428  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6429  __Pyx_RefNannySetupContext("set_csc_matrix_double", 0);
6430  __Pyx_TraceCall("set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6431 
6432  /* "imate/_c_linear_operator/py_c_matrix.pyx":577
6433  *
6434  * # Matrix size
6435  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6436  * cdef LongIndexType A_num_columns = A.shape[1]
6437  *
6438  */
6439  __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6440  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6441  __Pyx_GOTREF(__pyx_t_1);
6442  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6443  __Pyx_GOTREF(__pyx_t_2);
6444  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6445  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6446  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6447  __pyx_v_A_num_rows = __pyx_t_3;
6448 
6449  /* "imate/_c_linear_operator/py_c_matrix.pyx":578
6450  * # Matrix size
6451  * cdef LongIndexType A_num_rows = A.shape[0]
6452  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6453  *
6454  * # Declare memoryviews to get pointer of A.data
6455  */
6456  __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6457  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6458  __Pyx_GOTREF(__pyx_t_2);
6459  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6460  __Pyx_GOTREF(__pyx_t_1);
6461  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6462  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6463  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6464  __pyx_v_A_num_columns = __pyx_t_3;
6465 
6466  /* "imate/_c_linear_operator/py_c_matrix.pyx":588
6467  * # If the input type is the same as LongIndexType, no copy is performed.
6468  * self.A_indices_copy = \
6469  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6470  * self.A_index_pointer_copy = \
6471  * A.indptr.astype(self.long_index_type_name, copy=False)
6472  */
6473  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6474  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6475  __Pyx_GOTREF(__pyx_t_1);
6476  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6477  __Pyx_GOTREF(__pyx_t_2);
6478  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6479  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6480  __Pyx_GOTREF(__pyx_t_1);
6481  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6482  __Pyx_GOTREF(__pyx_t_4);
6483  __Pyx_GIVEREF(__pyx_t_1);
6484  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6485  __pyx_t_1 = 0;
6486  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6487  __Pyx_GOTREF(__pyx_t_1);
6488  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6489  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6490  __Pyx_GOTREF(__pyx_t_5);
6491  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6492  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6493  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6494 
6495  /* "imate/_c_linear_operator/py_c_matrix.pyx":587
6496  *
6497  * # If the input type is the same as LongIndexType, no copy is performed.
6498  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6499  * A.indices.astype(self.long_index_type_name, copy=False)
6500  * self.A_index_pointer_copy = \
6501  */
6502  __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6503  __Pyx_GIVEREF(__pyx_t_5);
6504  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6505  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6506  __pyx_v_self->A_indices_copy = __pyx_t_5;
6507  __pyx_t_5 = 0;
6508 
6509  /* "imate/_c_linear_operator/py_c_matrix.pyx":590
6510  * A.indices.astype(self.long_index_type_name, copy=False)
6511  * self.A_index_pointer_copy = \
6512  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6513  *
6514  * # Declare memoryviews to get pointer of A.indices and A.indptr
6515  */
6516  __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6517  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6518  __Pyx_GOTREF(__pyx_t_5);
6519  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6520  __Pyx_GOTREF(__pyx_t_1);
6521  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6522  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6523  __Pyx_GOTREF(__pyx_t_5);
6524  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6525  __Pyx_GOTREF(__pyx_t_4);
6526  __Pyx_GIVEREF(__pyx_t_5);
6527  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6528  __pyx_t_5 = 0;
6529  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6530  __Pyx_GOTREF(__pyx_t_5);
6531  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6532  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6533  __Pyx_GOTREF(__pyx_t_2);
6534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6535  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6536  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6537 
6538  /* "imate/_c_linear_operator/py_c_matrix.pyx":589
6539  * self.A_indices_copy = \
6540  * A.indices.astype(self.long_index_type_name, copy=False)
6541  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6542  * A.indptr.astype(self.long_index_type_name, copy=False)
6543  *
6544  */
6545  __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6546  __Pyx_GIVEREF(__pyx_t_2);
6547  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6548  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6549  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6550  __pyx_t_2 = 0;
6551 
6552  /* "imate/_c_linear_operator/py_c_matrix.pyx":593
6553  *
6554  * # Declare memoryviews to get pointer of A.indices and A.indptr
6555  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6556  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6557  * self.A_index_pointer_copy
6558  */
6559  __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6560  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6561  __pyx_v_A_indices_mv = __pyx_t_6;
6562  __pyx_t_6.memview = NULL;
6563  __pyx_t_6.data = NULL;
6564 
6565  /* "imate/_c_linear_operator/py_c_matrix.pyx":595
6566  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6567  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6568  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6569  *
6570  * # Declare pointers to A.indices ans A.indptr
6571  */
6572  __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6573  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6574  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6575  __pyx_t_6.memview = NULL;
6576  __pyx_t_6.data = NULL;
6577 
6578  /* "imate/_c_linear_operator/py_c_matrix.pyx":598
6579  *
6580  * # Declare pointers to A.indices ans A.indptr
6581  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6582  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6583  *
6584  */
6585  __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6586  __pyx_t_7 = 0;
6587  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6588 
6589  /* "imate/_c_linear_operator/py_c_matrix.pyx":599
6590  * # Declare pointers to A.indices ans A.indptr
6591  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6592  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6593  *
6594  * # Memoryview of A data
6595  */
6596  __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6597  __pyx_t_7 = 0;
6598  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6599 
6600  /* "imate/_c_linear_operator/py_c_matrix.pyx":602
6601  *
6602  * # Memoryview of A data
6603  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
6604  *
6605  * # Get pointers
6606  */
6607  __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6608  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6609  __Pyx_GOTREF(__pyx_t_2);
6610  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6611  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6612  __pyx_v_A_data_double_mv = __pyx_t_8;
6613  __pyx_t_8.memview = NULL;
6614  __pyx_t_8.data = NULL;
6615 
6616  /* "imate/_c_linear_operator/py_c_matrix.pyx":605
6617  *
6618  * # Get pointers
6619  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
6620  *
6621  * # Create a linear operator object
6622  */
6623  __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6624  __pyx_t_7 = 0;
6625  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6626 
6627  /* "imate/_c_linear_operator/py_c_matrix.pyx":608
6628  *
6629  * # Create a linear operator object
6630  * self.Aop_double = new cCSCMatrix[double]( # <<<<<<<<<<<<<<
6631  * A_data_double,
6632  * A_indices,
6633  */
6634  __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6635  try {
6636  __pyx_t_9 = new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6637  } catch(...) {
6638  __Pyx_CppExn2PyErr();
6639  __PYX_ERR(0, 608, __pyx_L1_error)
6640  }
6641  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6642 
6643  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6644  * # =====================
6645  *
6646  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6647  * """
6648  * """
6649  */
6650 
6651  /* function exit code */
6652  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6653  goto __pyx_L0;
6654  __pyx_L1_error:;
6655  __Pyx_XDECREF(__pyx_t_1);
6656  __Pyx_XDECREF(__pyx_t_2);
6657  __Pyx_XDECREF(__pyx_t_4);
6658  __Pyx_XDECREF(__pyx_t_5);
6659  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6660  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6661  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6662  __pyx_r = NULL;
6663  __pyx_L0:;
6664  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6665  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6666  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6667  __Pyx_XGIVEREF(__pyx_r);
6668  __Pyx_TraceReturn(__pyx_r, 0);
6669  __Pyx_RefNannyFinishContext();
6670  return __pyx_r;
6671 }
6672 
6673 /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6674  * # ==========================
6675  *
6676  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6677  * """
6678  * """
6679  */
6680 
6681 /* Python wrapper */
6682 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6683 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] = "pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6684 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6685 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6686  PyObject *__pyx_r = 0;
6687  __Pyx_RefNannyDeclarations
6688  __Pyx_RefNannySetupContext("set_csc_matrix_long_double (wrapper)", 0);
6689  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6690 
6691  /* function exit code */
6692  __Pyx_RefNannyFinishContext();
6693  return __pyx_r;
6694 }
6695 
6696 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6697  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6698  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6699  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6700  long double *__pyx_v_A_data_long_double;
6701  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6702  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6703  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6704  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6705  PyObject *__pyx_r = NULL;
6706  __Pyx_TraceDeclarations
6707  __Pyx_RefNannyDeclarations
6708  PyObject *__pyx_t_1 = NULL;
6709  PyObject *__pyx_t_2 = NULL;
6710  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6711  PyObject *__pyx_t_4 = NULL;
6712  PyObject *__pyx_t_5 = NULL;
6713  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6714  Py_ssize_t __pyx_t_7;
6715  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6716  cCSCMatrix<long double> *__pyx_t_9;
6717  int __pyx_lineno = 0;
6718  const char *__pyx_filename = NULL;
6719  int __pyx_clineno = 0;
6720  __Pyx_TraceFrameInit(__pyx_codeobj__13)
6721  __Pyx_RefNannySetupContext("set_csc_matrix_long_double", 0);
6722  __Pyx_TraceCall("set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6723 
6724  /* "imate/_c_linear_operator/py_c_matrix.pyx":624
6725  *
6726  * # Matrix size
6727  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6728  * cdef LongIndexType A_num_columns = A.shape[1]
6729  *
6730  */
6731  __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6732  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6733  __Pyx_GOTREF(__pyx_t_1);
6734  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6735  __Pyx_GOTREF(__pyx_t_2);
6736  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6738  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6739  __pyx_v_A_num_rows = __pyx_t_3;
6740 
6741  /* "imate/_c_linear_operator/py_c_matrix.pyx":625
6742  * # Matrix size
6743  * cdef LongIndexType A_num_rows = A.shape[0]
6744  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6745  *
6746  * # Declare memoryviews to get pointer of A.data
6747  */
6748  __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6749  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6750  __Pyx_GOTREF(__pyx_t_2);
6751  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6752  __Pyx_GOTREF(__pyx_t_1);
6753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6754  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6756  __pyx_v_A_num_columns = __pyx_t_3;
6757 
6758  /* "imate/_c_linear_operator/py_c_matrix.pyx":635
6759  * # If the input type is the same as LongIndexType, no copy is performed.
6760  * self.A_indices_copy = \
6761  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6762  * self.A_index_pointer_copy = \
6763  * A.indptr.astype(self.long_index_type_name, copy=False)
6764  */
6765  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6766  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6767  __Pyx_GOTREF(__pyx_t_1);
6768  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6769  __Pyx_GOTREF(__pyx_t_2);
6770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6771  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6772  __Pyx_GOTREF(__pyx_t_1);
6773  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6774  __Pyx_GOTREF(__pyx_t_4);
6775  __Pyx_GIVEREF(__pyx_t_1);
6776  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6777  __pyx_t_1 = 0;
6778  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6779  __Pyx_GOTREF(__pyx_t_1);
6780  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6781  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6782  __Pyx_GOTREF(__pyx_t_5);
6783  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6784  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6786 
6787  /* "imate/_c_linear_operator/py_c_matrix.pyx":634
6788  *
6789  * # If the input type is the same as LongIndexType, no copy is performed.
6790  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6791  * A.indices.astype(self.long_index_type_name, copy=False)
6792  * self.A_index_pointer_copy = \
6793  */
6794  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6795  __Pyx_GIVEREF(__pyx_t_5);
6796  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6797  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6798  __pyx_v_self->A_indices_copy = __pyx_t_5;
6799  __pyx_t_5 = 0;
6800 
6801  /* "imate/_c_linear_operator/py_c_matrix.pyx":637
6802  * A.indices.astype(self.long_index_type_name, copy=False)
6803  * self.A_index_pointer_copy = \
6804  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6805  *
6806  * # Declare memoryviews to get pointer of A.indices and A.indptr
6807  */
6808  __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6809  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6810  __Pyx_GOTREF(__pyx_t_5);
6811  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6812  __Pyx_GOTREF(__pyx_t_1);
6813  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6814  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6815  __Pyx_GOTREF(__pyx_t_5);
6816  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6817  __Pyx_GOTREF(__pyx_t_4);
6818  __Pyx_GIVEREF(__pyx_t_5);
6819  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6820  __pyx_t_5 = 0;
6821  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6822  __Pyx_GOTREF(__pyx_t_5);
6823  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6824  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6825  __Pyx_GOTREF(__pyx_t_2);
6826  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6827  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6828  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6829 
6830  /* "imate/_c_linear_operator/py_c_matrix.pyx":636
6831  * self.A_indices_copy = \
6832  * A.indices.astype(self.long_index_type_name, copy=False)
6833  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6834  * A.indptr.astype(self.long_index_type_name, copy=False)
6835  *
6836  */
6837  __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6838  __Pyx_GIVEREF(__pyx_t_2);
6839  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6840  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6841  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6842  __pyx_t_2 = 0;
6843 
6844  /* "imate/_c_linear_operator/py_c_matrix.pyx":640
6845  *
6846  * # Declare memoryviews to get pointer of A.indices and A.indptr
6847  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6848  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6849  * self.A_index_pointer_copy
6850  */
6851  __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6852  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6853  __pyx_v_A_indices_mv = __pyx_t_6;
6854  __pyx_t_6.memview = NULL;
6855  __pyx_t_6.data = NULL;
6856 
6857  /* "imate/_c_linear_operator/py_c_matrix.pyx":642
6858  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6859  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6860  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6861  *
6862  * # Declare pointers to A.indices ans A.indptr
6863  */
6864  __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6865  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6866  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6867  __pyx_t_6.memview = NULL;
6868  __pyx_t_6.data = NULL;
6869 
6870  /* "imate/_c_linear_operator/py_c_matrix.pyx":645
6871  *
6872  * # Declare pointers to A.indices ans A.indptr
6873  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6874  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6875  *
6876  */
6877  __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6878  __pyx_t_7 = 0;
6879  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6880 
6881  /* "imate/_c_linear_operator/py_c_matrix.pyx":646
6882  * # Declare pointers to A.indices ans A.indptr
6883  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6884  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6885  *
6886  * # Memoryview of A data
6887  */
6888  __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6889  __pyx_t_7 = 0;
6890  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6891 
6892  /* "imate/_c_linear_operator/py_c_matrix.pyx":649
6893  *
6894  * # Memoryview of A data
6895  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
6896  *
6897  * # Get pointers
6898  */
6899  __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6900  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6901  __Pyx_GOTREF(__pyx_t_2);
6902  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6903  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6904  __pyx_v_A_data_long_double_mv = __pyx_t_8;
6905  __pyx_t_8.memview = NULL;
6906  __pyx_t_8.data = NULL;
6907 
6908  /* "imate/_c_linear_operator/py_c_matrix.pyx":652
6909  *
6910  * # Get pointers
6911  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
6912  *
6913  * # Create a linear operator object
6914  */
6915  __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6916  __pyx_t_7 = 0;
6917  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6918 
6919  /* "imate/_c_linear_operator/py_c_matrix.pyx":655
6920  *
6921  * # Create a linear operator object
6922  * self.Aop_long_double = new cCSCMatrix[long double]( # <<<<<<<<<<<<<<
6923  * A_data_long_double,
6924  * A_indices,
6925  */
6926  __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6927  try {
6928  __pyx_t_9 = new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6929  } catch(...) {
6930  __Pyx_CppExn2PyErr();
6931  __PYX_ERR(0, 655, __pyx_L1_error)
6932  }
6933  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6934 
6935  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6936  * # ==========================
6937  *
6938  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6939  * """
6940  * """
6941  */
6942 
6943  /* function exit code */
6944  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6945  goto __pyx_L0;
6946  __pyx_L1_error:;
6947  __Pyx_XDECREF(__pyx_t_1);
6948  __Pyx_XDECREF(__pyx_t_2);
6949  __Pyx_XDECREF(__pyx_t_4);
6950  __Pyx_XDECREF(__pyx_t_5);
6951  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6952  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6953  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6954  __pyx_r = NULL;
6955  __pyx_L0:;
6956  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6957  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6958  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6959  __Pyx_XGIVEREF(__pyx_r);
6960  __Pyx_TraceReturn(__pyx_r, 0);
6961  __Pyx_RefNannyFinishContext();
6962  return __pyx_r;
6963 }
6964 
6965 /* "(tree fragment)":1
6966  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6967  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6968  * def __setstate_cython__(self, __pyx_state):
6969  */
6970 
6971 /* Python wrapper */
6972 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6973 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] = "pycMatrix.__reduce_cython__(self)";
6974 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6975 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6976  PyObject *__pyx_r = 0;
6977  __Pyx_RefNannyDeclarations
6978  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6979  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6980 
6981  /* function exit code */
6982  __Pyx_RefNannyFinishContext();
6983  return __pyx_r;
6984 }
6985 
6986 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6987  PyObject *__pyx_r = NULL;
6988  __Pyx_TraceDeclarations
6989  __Pyx_RefNannyDeclarations
6990  PyObject *__pyx_t_1 = NULL;
6991  int __pyx_lineno = 0;
6992  const char *__pyx_filename = NULL;
6993  int __pyx_clineno = 0;
6994  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6995  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6996  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6997 
6998  /* "(tree fragment)":2
6999  * def __reduce_cython__(self):
7000  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7001  * def __setstate_cython__(self, __pyx_state):
7002  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7003  */
7004  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
7005  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
7006  __Pyx_GOTREF(__pyx_t_1);
7007  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7008  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7009  __PYX_ERR(1, 2, __pyx_L1_error)
7010 
7011  /* "(tree fragment)":1
7012  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7013  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7014  * def __setstate_cython__(self, __pyx_state):
7015  */
7016 
7017  /* function exit code */
7018  __pyx_L1_error:;
7019  __Pyx_XDECREF(__pyx_t_1);
7020  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7021  __pyx_r = NULL;
7022  __Pyx_XGIVEREF(__pyx_r);
7023  __Pyx_TraceReturn(__pyx_r, 0);
7024  __Pyx_RefNannyFinishContext();
7025  return __pyx_r;
7026 }
7027 
7028 /* "(tree fragment)":3
7029  * def __reduce_cython__(self):
7030  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7031  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7032  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7033  */
7034 
7035 /* Python wrapper */
7036 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7037 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] = "pycMatrix.__setstate_cython__(self, __pyx_state)";
7038 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
7039 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7040  PyObject *__pyx_r = 0;
7041  __Pyx_RefNannyDeclarations
7042  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7043  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7044 
7045  /* function exit code */
7046  __Pyx_RefNannyFinishContext();
7047  return __pyx_r;
7048 }
7049 
7050 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7051  PyObject *__pyx_r = NULL;
7052  __Pyx_TraceDeclarations
7053  __Pyx_RefNannyDeclarations
7054  PyObject *__pyx_t_1 = NULL;
7055  int __pyx_lineno = 0;
7056  const char *__pyx_filename = NULL;
7057  int __pyx_clineno = 0;
7058  __Pyx_TraceFrameInit(__pyx_codeobj__16)
7059  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7060  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
7061 
7062  /* "(tree fragment)":4
7063  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7064  * def __setstate_cython__(self, __pyx_state):
7065  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7066  */
7067  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
7068  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
7069  __Pyx_GOTREF(__pyx_t_1);
7070  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7071  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7072  __PYX_ERR(1, 4, __pyx_L1_error)
7073 
7074  /* "(tree fragment)":3
7075  * def __reduce_cython__(self):
7076  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7077  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7078  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7079  */
7080 
7081  /* function exit code */
7082  __pyx_L1_error:;
7083  __Pyx_XDECREF(__pyx_t_1);
7084  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7085  __pyx_r = NULL;
7086  __Pyx_XGIVEREF(__pyx_r);
7087  __Pyx_TraceReturn(__pyx_r, 0);
7088  __Pyx_RefNannyFinishContext();
7089  return __pyx_r;
7090 }
7091 
7092 /* "View.MemoryView":123
7093  * cdef bint dtype_is_object
7094  *
7095  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7096  * mode="c", bint allocate_buffer=True):
7097  *
7098  */
7099 
7100 /* Python wrapper */
7101 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7102 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7103  PyObject *__pyx_v_shape = 0;
7104  Py_ssize_t __pyx_v_itemsize;
7105  PyObject *__pyx_v_format = 0;
7106  PyObject *__pyx_v_mode = 0;
7107  int __pyx_v_allocate_buffer;
7108  int __pyx_lineno = 0;
7109  const char *__pyx_filename = NULL;
7110  int __pyx_clineno = 0;
7111  int __pyx_r;
7112  __Pyx_RefNannyDeclarations
7113  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7114  {
7115  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7116  PyObject* values[5] = {0,0,0,0,0};
7117  values[3] = ((PyObject *)__pyx_n_s_c);
7118  if (unlikely(__pyx_kwds)) {
7119  Py_ssize_t kw_args;
7120  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7121  switch (pos_args) {
7122  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7123  CYTHON_FALLTHROUGH;
7124  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7125  CYTHON_FALLTHROUGH;
7126  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7127  CYTHON_FALLTHROUGH;
7128  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7129  CYTHON_FALLTHROUGH;
7130  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7131  CYTHON_FALLTHROUGH;
7132  case 0: break;
7133  default: goto __pyx_L5_argtuple_error;
7134  }
7135  kw_args = PyDict_Size(__pyx_kwds);
7136  switch (pos_args) {
7137  case 0:
7138  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7139  else goto __pyx_L5_argtuple_error;
7140  CYTHON_FALLTHROUGH;
7141  case 1:
7142  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7143  else {
7144  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
7145  }
7146  CYTHON_FALLTHROUGH;
7147  case 2:
7148  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7149  else {
7150  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
7151  }
7152  CYTHON_FALLTHROUGH;
7153  case 3:
7154  if (kw_args > 0) {
7155  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7156  if (value) { values[3] = value; kw_args--; }
7157  }
7158  CYTHON_FALLTHROUGH;
7159  case 4:
7160  if (kw_args > 0) {
7161  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7162  if (value) { values[4] = value; kw_args--; }
7163  }
7164  }
7165  if (unlikely(kw_args > 0)) {
7166  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
7167  }
7168  } else {
7169  switch (PyTuple_GET_SIZE(__pyx_args)) {
7170  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7171  CYTHON_FALLTHROUGH;
7172  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7173  CYTHON_FALLTHROUGH;
7174  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7175  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7176  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7177  break;
7178  default: goto __pyx_L5_argtuple_error;
7179  }
7180  }
7181  __pyx_v_shape = ((PyObject*)values[0]);
7182  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7183  __pyx_v_format = values[2];
7184  __pyx_v_mode = values[3];
7185  if (values[4]) {
7186  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
7187  } else {
7188 
7189  /* "View.MemoryView":124
7190  *
7191  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7192  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7193  *
7194  * cdef int idx
7195  */
7196  __pyx_v_allocate_buffer = ((int)1);
7197  }
7198  }
7199  goto __pyx_L4_argument_unpacking_done;
7200  __pyx_L5_argtuple_error:;
7201  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
7202  __pyx_L3_error:;
7203  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7204  __Pyx_RefNannyFinishContext();
7205  return -1;
7206  __pyx_L4_argument_unpacking_done:;
7207  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
7208  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7209  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 123, __pyx_L1_error)
7210  }
7211  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7212 
7213  /* "View.MemoryView":123
7214  * cdef bint dtype_is_object
7215  *
7216  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7217  * mode="c", bint allocate_buffer=True):
7218  *
7219  */
7220 
7221  /* function exit code */
7222  goto __pyx_L0;
7223  __pyx_L1_error:;
7224  __pyx_r = -1;
7225  __pyx_L0:;
7226  __Pyx_RefNannyFinishContext();
7227  return __pyx_r;
7228 }
7229 
7230 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7231  int __pyx_v_idx;
7232  Py_ssize_t __pyx_v_i;
7233  Py_ssize_t __pyx_v_dim;
7234  PyObject **__pyx_v_p;
7235  char __pyx_v_order;
7236  int __pyx_r;
7237  __Pyx_TraceDeclarations
7238  __Pyx_RefNannyDeclarations
7239  Py_ssize_t __pyx_t_1;
7240  int __pyx_t_2;
7241  PyObject *__pyx_t_3 = NULL;
7242  int __pyx_t_4;
7243  PyObject *__pyx_t_5 = NULL;
7244  PyObject *__pyx_t_6 = NULL;
7245  char *__pyx_t_7;
7246  int __pyx_t_8;
7247  Py_ssize_t __pyx_t_9;
7248  PyObject *__pyx_t_10 = NULL;
7249  Py_ssize_t __pyx_t_11;
7250  int __pyx_lineno = 0;
7251  const char *__pyx_filename = NULL;
7252  int __pyx_clineno = 0;
7253  __Pyx_RefNannySetupContext("__cinit__", 0);
7254  __Pyx_TraceCall("__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
7255  __Pyx_INCREF(__pyx_v_format);
7256 
7257  /* "View.MemoryView":130
7258  * cdef PyObject **p
7259  *
7260  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7261  * self.itemsize = itemsize
7262  *
7263  */
7264  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
7265  if (unlikely(__pyx_v_shape == Py_None)) {
7266  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7267  __PYX_ERR(1, 130, __pyx_L1_error)
7268  }
7269  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
7270  __pyx_v_self->ndim = ((int)__pyx_t_1);
7271 
7272  /* "View.MemoryView":131
7273  *
7274  * self.ndim = <int> len(shape)
7275  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7276  *
7277  * if not self.ndim:
7278  */
7279  __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
7280  __pyx_v_self->itemsize = __pyx_v_itemsize;
7281 
7282  /* "View.MemoryView":133
7283  * self.itemsize = itemsize
7284  *
7285  * if not self.ndim: # <<<<<<<<<<<<<<
7286  * raise ValueError("Empty shape tuple for cython.array")
7287  *
7288  */
7289  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
7290  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7291  if (unlikely(__pyx_t_2)) {
7292 
7293  /* "View.MemoryView":134
7294  *
7295  * if not self.ndim:
7296  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7297  *
7298  * if itemsize <= 0:
7299  */
7300  __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
7301  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
7302  __Pyx_GOTREF(__pyx_t_3);
7303  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7304  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7305  __PYX_ERR(1, 134, __pyx_L1_error)
7306 
7307  /* "View.MemoryView":133
7308  * self.itemsize = itemsize
7309  *
7310  * if not self.ndim: # <<<<<<<<<<<<<<
7311  * raise ValueError("Empty shape tuple for cython.array")
7312  *
7313  */
7314  }
7315 
7316  /* "View.MemoryView":136
7317  * raise ValueError("Empty shape tuple for cython.array")
7318  *
7319  * if itemsize <= 0: # <<<<<<<<<<<<<<
7320  * raise ValueError("itemsize <= 0 for cython.array")
7321  *
7322  */
7323  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7324  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7325  if (unlikely(__pyx_t_2)) {
7326 
7327  /* "View.MemoryView":137
7328  *
7329  * if itemsize <= 0:
7330  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7331  *
7332  * if not isinstance(format, bytes):
7333  */
7334  __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
7335  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
7336  __Pyx_GOTREF(__pyx_t_3);
7337  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7338  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7339  __PYX_ERR(1, 137, __pyx_L1_error)
7340 
7341  /* "View.MemoryView":136
7342  * raise ValueError("Empty shape tuple for cython.array")
7343  *
7344  * if itemsize <= 0: # <<<<<<<<<<<<<<
7345  * raise ValueError("itemsize <= 0 for cython.array")
7346  *
7347  */
7348  }
7349 
7350  /* "View.MemoryView":139
7351  * raise ValueError("itemsize <= 0 for cython.array")
7352  *
7353  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7354  * format = format.encode('ASCII')
7355  * self._format = format # keep a reference to the byte string
7356  */
7357  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7358  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7359  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7360  if (__pyx_t_4) {
7361 
7362  /* "View.MemoryView":140
7363  *
7364  * if not isinstance(format, bytes):
7365  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7366  * self._format = format # keep a reference to the byte string
7367  * self.format = self._format
7368  */
7369  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7370  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
7371  __Pyx_GOTREF(__pyx_t_5);
7372  __pyx_t_6 = NULL;
7373  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7374  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7375  if (likely(__pyx_t_6)) {
7376  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7377  __Pyx_INCREF(__pyx_t_6);
7378  __Pyx_INCREF(function);
7379  __Pyx_DECREF_SET(__pyx_t_5, function);
7380  }
7381  }
7382  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7383  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7384  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
7385  __Pyx_GOTREF(__pyx_t_3);
7386  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7387  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7388  __pyx_t_3 = 0;
7389 
7390  /* "View.MemoryView":139
7391  * raise ValueError("itemsize <= 0 for cython.array")
7392  *
7393  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7394  * format = format.encode('ASCII')
7395  * self._format = format # keep a reference to the byte string
7396  */
7397  }
7398 
7399  /* "View.MemoryView":141
7400  * if not isinstance(format, bytes):
7401  * format = format.encode('ASCII')
7402  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7403  * self.format = self._format
7404  *
7405  */
7406  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7407  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
7408  __pyx_t_3 = __pyx_v_format;
7409  __Pyx_INCREF(__pyx_t_3);
7410  __Pyx_GIVEREF(__pyx_t_3);
7411  __Pyx_GOTREF(__pyx_v_self->_format);
7412  __Pyx_DECREF(__pyx_v_self->_format);
7413  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7414  __pyx_t_3 = 0;
7415 
7416  /* "View.MemoryView":142
7417  * format = format.encode('ASCII')
7418  * self._format = format # keep a reference to the byte string
7419  * self.format = self._format # <<<<<<<<<<<<<<
7420  *
7421  *
7422  */
7423  __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
7424  if (unlikely(__pyx_v_self->_format == Py_None)) {
7425  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7426  __PYX_ERR(1, 142, __pyx_L1_error)
7427  }
7428  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
7429  __pyx_v_self->format = __pyx_t_7;
7430 
7431  /* "View.MemoryView":145
7432  *
7433  *
7434  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7435  * self._strides = self._shape + self.ndim
7436  *
7437  */
7438  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7439  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7440 
7441  /* "View.MemoryView":146
7442  *
7443  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7444  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7445  *
7446  * if not self._shape:
7447  */
7448  __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
7449  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7450 
7451  /* "View.MemoryView":148
7452  * self._strides = self._shape + self.ndim
7453  *
7454  * if not self._shape: # <<<<<<<<<<<<<<
7455  * raise MemoryError("unable to allocate shape and strides.")
7456  *
7457  */
7458  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7459  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7460  if (unlikely(__pyx_t_4)) {
7461 
7462  /* "View.MemoryView":149
7463  *
7464  * if not self._shape:
7465  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
7466  *
7467  *
7468  */
7469  __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
7470  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
7471  __Pyx_GOTREF(__pyx_t_3);
7472  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7473  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7474  __PYX_ERR(1, 149, __pyx_L1_error)
7475 
7476  /* "View.MemoryView":148
7477  * self._strides = self._shape + self.ndim
7478  *
7479  * if not self._shape: # <<<<<<<<<<<<<<
7480  * raise MemoryError("unable to allocate shape and strides.")
7481  *
7482  */
7483  }
7484 
7485  /* "View.MemoryView":152
7486  *
7487  *
7488  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7489  * if dim <= 0:
7490  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7491  */
7492  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7493  __pyx_t_8 = 0;
7494  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7495  for (;;) {
7496  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7497  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7498  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
7499  #else
7500  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
7501  __Pyx_GOTREF(__pyx_t_5);
7502  #endif
7503  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
7504  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7505  __pyx_v_dim = __pyx_t_9;
7506  __pyx_v_idx = __pyx_t_8;
7507  __pyx_t_8 = (__pyx_t_8 + 1);
7508 
7509  /* "View.MemoryView":153
7510  *
7511  * for idx, dim in enumerate(shape):
7512  * if dim <= 0: # <<<<<<<<<<<<<<
7513  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7514  * self._shape[idx] = dim
7515  */
7516  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7517  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7518  if (unlikely(__pyx_t_4)) {
7519 
7520  /* "View.MemoryView":154
7521  * for idx, dim in enumerate(shape):
7522  * if dim <= 0:
7523  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
7524  * self._shape[idx] = dim
7525  *
7526  */
7527  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7528  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
7529  __Pyx_GOTREF(__pyx_t_5);
7530  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7531  __Pyx_GOTREF(__pyx_t_6);
7532  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7533  __Pyx_GOTREF(__pyx_t_10);
7534  __Pyx_GIVEREF(__pyx_t_5);
7535  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7536  __Pyx_GIVEREF(__pyx_t_6);
7537  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7538  __pyx_t_5 = 0;
7539  __pyx_t_6 = 0;
7540  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7541  __Pyx_GOTREF(__pyx_t_6);
7542  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7543  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7544  __Pyx_GOTREF(__pyx_t_10);
7545  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7546  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7547  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7548  __PYX_ERR(1, 154, __pyx_L1_error)
7549 
7550  /* "View.MemoryView":153
7551  *
7552  * for idx, dim in enumerate(shape):
7553  * if dim <= 0: # <<<<<<<<<<<<<<
7554  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7555  * self._shape[idx] = dim
7556  */
7557  }
7558 
7559  /* "View.MemoryView":155
7560  * if dim <= 0:
7561  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7562  * self._shape[idx] = dim # <<<<<<<<<<<<<<
7563  *
7564  * cdef char order
7565  */
7566  __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
7567  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7568 
7569  /* "View.MemoryView":152
7570  *
7571  *
7572  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7573  * if dim <= 0:
7574  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7575  */
7576  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7577  }
7578  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7579 
7580  /* "View.MemoryView":158
7581  *
7582  * cdef char order
7583  * if mode == 'fortran': # <<<<<<<<<<<<<<
7584  * order = b'F'
7585  * self.mode = u'fortran'
7586  */
7587  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7588  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
7589  if (__pyx_t_4) {
7590 
7591  /* "View.MemoryView":159
7592  * cdef char order
7593  * if mode == 'fortran':
7594  * order = b'F' # <<<<<<<<<<<<<<
7595  * self.mode = u'fortran'
7596  * elif mode == 'c':
7597  */
7598  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7599  __pyx_v_order = 'F';
7600 
7601  /* "View.MemoryView":160
7602  * if mode == 'fortran':
7603  * order = b'F'
7604  * self.mode = u'fortran' # <<<<<<<<<<<<<<
7605  * elif mode == 'c':
7606  * order = b'C'
7607  */
7608  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7609  __Pyx_INCREF(__pyx_n_u_fortran);
7610  __Pyx_GIVEREF(__pyx_n_u_fortran);
7611  __Pyx_GOTREF(__pyx_v_self->mode);
7612  __Pyx_DECREF(__pyx_v_self->mode);
7613  __pyx_v_self->mode = __pyx_n_u_fortran;
7614 
7615  /* "View.MemoryView":158
7616  *
7617  * cdef char order
7618  * if mode == 'fortran': # <<<<<<<<<<<<<<
7619  * order = b'F'
7620  * self.mode = u'fortran'
7621  */
7622  goto __pyx_L10;
7623  }
7624 
7625  /* "View.MemoryView":161
7626  * order = b'F'
7627  * self.mode = u'fortran'
7628  * elif mode == 'c': # <<<<<<<<<<<<<<
7629  * order = b'C'
7630  * self.mode = u'c'
7631  */
7632  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7633  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
7634  if (likely(__pyx_t_4)) {
7635 
7636  /* "View.MemoryView":162
7637  * self.mode = u'fortran'
7638  * elif mode == 'c':
7639  * order = b'C' # <<<<<<<<<<<<<<
7640  * self.mode = u'c'
7641  * else:
7642  */
7643  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7644  __pyx_v_order = 'C';
7645 
7646  /* "View.MemoryView":163
7647  * elif mode == 'c':
7648  * order = b'C'
7649  * self.mode = u'c' # <<<<<<<<<<<<<<
7650  * else:
7651  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7652  */
7653  __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
7654  __Pyx_INCREF(__pyx_n_u_c);
7655  __Pyx_GIVEREF(__pyx_n_u_c);
7656  __Pyx_GOTREF(__pyx_v_self->mode);
7657  __Pyx_DECREF(__pyx_v_self->mode);
7658  __pyx_v_self->mode = __pyx_n_u_c;
7659 
7660  /* "View.MemoryView":161
7661  * order = b'F'
7662  * self.mode = u'fortran'
7663  * elif mode == 'c': # <<<<<<<<<<<<<<
7664  * order = b'C'
7665  * self.mode = u'c'
7666  */
7667  goto __pyx_L10;
7668  }
7669 
7670  /* "View.MemoryView":165
7671  * self.mode = u'c'
7672  * else:
7673  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
7674  *
7675  * self.len = fill_contig_strides_array(self._shape, self._strides,
7676  */
7677  __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
7678  /*else*/ {
7679  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
7680  __Pyx_GOTREF(__pyx_t_3);
7681  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
7682  __Pyx_GOTREF(__pyx_t_10);
7683  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7684  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7685  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7686  __PYX_ERR(1, 165, __pyx_L1_error)
7687  }
7688  __pyx_L10:;
7689 
7690  /* "View.MemoryView":167
7691  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7692  *
7693  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
7694  * itemsize, self.ndim, order)
7695  *
7696  */
7697  __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
7698  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7699 
7700  /* "View.MemoryView":170
7701  * itemsize, self.ndim, order)
7702  *
7703  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
7704  * self.dtype_is_object = format == b'O'
7705  * if allocate_buffer:
7706  */
7707  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7708  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7709 
7710  /* "View.MemoryView":171
7711  *
7712  * self.free_data = allocate_buffer
7713  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
7714  * if allocate_buffer:
7715  *
7716  */
7717  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7718  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
7719  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
7720  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7721  __pyx_v_self->dtype_is_object = __pyx_t_4;
7722 
7723  /* "View.MemoryView":172
7724  * self.free_data = allocate_buffer
7725  * self.dtype_is_object = format == b'O'
7726  * if allocate_buffer: # <<<<<<<<<<<<<<
7727  *
7728  *
7729  */
7730  __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
7731  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7732  if (__pyx_t_4) {
7733 
7734  /* "View.MemoryView":175
7735  *
7736  *
7737  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7738  * if not self.data:
7739  * raise MemoryError("unable to allocate array data.")
7740  */
7741  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7742  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7743 
7744  /* "View.MemoryView":176
7745  *
7746  * self.data = <char *>malloc(self.len)
7747  * if not self.data: # <<<<<<<<<<<<<<
7748  * raise MemoryError("unable to allocate array data.")
7749  *
7750  */
7751  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7752  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7753  if (unlikely(__pyx_t_4)) {
7754 
7755  /* "View.MemoryView":177
7756  * self.data = <char *>malloc(self.len)
7757  * if not self.data:
7758  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
7759  *
7760  * if self.dtype_is_object:
7761  */
7762  __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
7763  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
7764  __Pyx_GOTREF(__pyx_t_10);
7765  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7766  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7767  __PYX_ERR(1, 177, __pyx_L1_error)
7768 
7769  /* "View.MemoryView":176
7770  *
7771  * self.data = <char *>malloc(self.len)
7772  * if not self.data: # <<<<<<<<<<<<<<
7773  * raise MemoryError("unable to allocate array data.")
7774  *
7775  */
7776  }
7777 
7778  /* "View.MemoryView":179
7779  * raise MemoryError("unable to allocate array data.")
7780  *
7781  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7782  * p = <PyObject **> self.data
7783  * for i in range(self.len / itemsize):
7784  */
7785  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7786  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7787  if (__pyx_t_4) {
7788 
7789  /* "View.MemoryView":180
7790  *
7791  * if self.dtype_is_object:
7792  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7793  * for i in range(self.len / itemsize):
7794  * p[i] = Py_None
7795  */
7796  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7797  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7798 
7799  /* "View.MemoryView":181
7800  * if self.dtype_is_object:
7801  * p = <PyObject **> self.data
7802  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
7803  * p[i] = Py_None
7804  * Py_INCREF(Py_None)
7805  */
7806  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7807  if (unlikely(__pyx_v_itemsize == 0)) {
7808  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7809  __PYX_ERR(1, 181, __pyx_L1_error)
7810  }
7811  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7812  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7813  __PYX_ERR(1, 181, __pyx_L1_error)
7814  }
7815  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7816  __pyx_t_9 = __pyx_t_1;
7817  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7818  __pyx_v_i = __pyx_t_11;
7819 
7820  /* "View.MemoryView":182
7821  * p = <PyObject **> self.data
7822  * for i in range(self.len / itemsize):
7823  * p[i] = Py_None # <<<<<<<<<<<<<<
7824  * Py_INCREF(Py_None)
7825  *
7826  */
7827  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7828  (__pyx_v_p[__pyx_v_i]) = Py_None;
7829 
7830  /* "View.MemoryView":183
7831  * for i in range(self.len / itemsize):
7832  * p[i] = Py_None
7833  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7834  *
7835  * @cname('getbuffer')
7836  */
7837  __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7838  Py_INCREF(Py_None);
7839  }
7840 
7841  /* "View.MemoryView":179
7842  * raise MemoryError("unable to allocate array data.")
7843  *
7844  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7845  * p = <PyObject **> self.data
7846  * for i in range(self.len / itemsize):
7847  */
7848  }
7849 
7850  /* "View.MemoryView":172
7851  * self.free_data = allocate_buffer
7852  * self.dtype_is_object = format == b'O'
7853  * if allocate_buffer: # <<<<<<<<<<<<<<
7854  *
7855  *
7856  */
7857  }
7858 
7859  /* "View.MemoryView":123
7860  * cdef bint dtype_is_object
7861  *
7862  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7863  * mode="c", bint allocate_buffer=True):
7864  *
7865  */
7866 
7867  /* function exit code */
7868  __pyx_r = 0;
7869  goto __pyx_L0;
7870  __pyx_L1_error:;
7871  __Pyx_XDECREF(__pyx_t_3);
7872  __Pyx_XDECREF(__pyx_t_5);
7873  __Pyx_XDECREF(__pyx_t_6);
7874  __Pyx_XDECREF(__pyx_t_10);
7875  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7876  __pyx_r = -1;
7877  __pyx_L0:;
7878  __Pyx_XDECREF(__pyx_v_format);
7879  __Pyx_TraceReturn(Py_None, 0);
7880  __Pyx_RefNannyFinishContext();
7881  return __pyx_r;
7882 }
7883 
7884 /* "View.MemoryView":186
7885  *
7886  * @cname('getbuffer')
7887  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7888  * cdef int bufmode = -1
7889  * if self.mode == u"c":
7890  */
7891 
7892 /* Python wrapper */
7893 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7894 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7895  int __pyx_r;
7896  __Pyx_RefNannyDeclarations
7897  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7898  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7899 
7900  /* function exit code */
7901  __Pyx_RefNannyFinishContext();
7902  return __pyx_r;
7903 }
7904 
7905 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7906  int __pyx_v_bufmode;
7907  int __pyx_r;
7908  __Pyx_TraceDeclarations
7909  __Pyx_RefNannyDeclarations
7910  int __pyx_t_1;
7911  int __pyx_t_2;
7912  PyObject *__pyx_t_3 = NULL;
7913  char *__pyx_t_4;
7914  Py_ssize_t __pyx_t_5;
7915  int __pyx_t_6;
7916  Py_ssize_t *__pyx_t_7;
7917  int __pyx_lineno = 0;
7918  const char *__pyx_filename = NULL;
7919  int __pyx_clineno = 0;
7920  if (__pyx_v_info == NULL) {
7921  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7922  return -1;
7923  }
7924  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7925  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7926  __Pyx_GIVEREF(__pyx_v_info->obj);
7927  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7928 
7929  /* "View.MemoryView":187
7930  * @cname('getbuffer')
7931  * def __getbuffer__(self, Py_buffer *info, int flags):
7932  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7933  * if self.mode == u"c":
7934  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7935  */
7936  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7937  __pyx_v_bufmode = -1;
7938 
7939  /* "View.MemoryView":188
7940  * def __getbuffer__(self, Py_buffer *info, int flags):
7941  * cdef int bufmode = -1
7942  * if self.mode == u"c": # <<<<<<<<<<<<<<
7943  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7944  * elif self.mode == u"fortran":
7945  */
7946  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7947  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7948  __pyx_t_2 = (__pyx_t_1 != 0);
7949  if (__pyx_t_2) {
7950 
7951  /* "View.MemoryView":189
7952  * cdef int bufmode = -1
7953  * if self.mode == u"c":
7954  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7955  * elif self.mode == u"fortran":
7956  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7957  */
7958  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7959  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7960 
7961  /* "View.MemoryView":188
7962  * def __getbuffer__(self, Py_buffer *info, int flags):
7963  * cdef int bufmode = -1
7964  * if self.mode == u"c": # <<<<<<<<<<<<<<
7965  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7966  * elif self.mode == u"fortran":
7967  */
7968  goto __pyx_L3;
7969  }
7970 
7971  /* "View.MemoryView":190
7972  * if self.mode == u"c":
7973  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7974  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7975  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7976  * if not (flags & bufmode):
7977  */
7978  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7979  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7980  __pyx_t_1 = (__pyx_t_2 != 0);
7981  if (__pyx_t_1) {
7982 
7983  /* "View.MemoryView":191
7984  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7985  * elif self.mode == u"fortran":
7986  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7987  * if not (flags & bufmode):
7988  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7989  */
7990  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7991  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7992 
7993  /* "View.MemoryView":190
7994  * if self.mode == u"c":
7995  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7996  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7997  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7998  * if not (flags & bufmode):
7999  */
8000  }
8001  __pyx_L3:;
8002 
8003  /* "View.MemoryView":192
8004  * elif self.mode == u"fortran":
8005  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8006  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8007  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8008  * info.buf = self.data
8009  */
8010  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
8011  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8012  if (unlikely(__pyx_t_1)) {
8013 
8014  /* "View.MemoryView":193
8015  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8016  * if not (flags & bufmode):
8017  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8018  * info.buf = self.data
8019  * info.len = self.len
8020  */
8021  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
8022  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
8023  __Pyx_GOTREF(__pyx_t_3);
8024  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8025  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8026  __PYX_ERR(1, 193, __pyx_L1_error)
8027 
8028  /* "View.MemoryView":192
8029  * elif self.mode == u"fortran":
8030  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8031  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8032  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8033  * info.buf = self.data
8034  */
8035  }
8036 
8037  /* "View.MemoryView":194
8038  * if not (flags & bufmode):
8039  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8040  * info.buf = self.data # <<<<<<<<<<<<<<
8041  * info.len = self.len
8042  * info.ndim = self.ndim
8043  */
8044  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
8045  __pyx_t_4 = __pyx_v_self->data;
8046  __pyx_v_info->buf = __pyx_t_4;
8047 
8048  /* "View.MemoryView":195
8049  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8050  * info.buf = self.data
8051  * info.len = self.len # <<<<<<<<<<<<<<
8052  * info.ndim = self.ndim
8053  * info.shape = self._shape
8054  */
8055  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
8056  __pyx_t_5 = __pyx_v_self->len;
8057  __pyx_v_info->len = __pyx_t_5;
8058 
8059  /* "View.MemoryView":196
8060  * info.buf = self.data
8061  * info.len = self.len
8062  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8063  * info.shape = self._shape
8064  * info.strides = self._strides
8065  */
8066  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
8067  __pyx_t_6 = __pyx_v_self->ndim;
8068  __pyx_v_info->ndim = __pyx_t_6;
8069 
8070  /* "View.MemoryView":197
8071  * info.len = self.len
8072  * info.ndim = self.ndim
8073  * info.shape = self._shape # <<<<<<<<<<<<<<
8074  * info.strides = self._strides
8075  * info.suboffsets = NULL
8076  */
8077  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
8078  __pyx_t_7 = __pyx_v_self->_shape;
8079  __pyx_v_info->shape = __pyx_t_7;
8080 
8081  /* "View.MemoryView":198
8082  * info.ndim = self.ndim
8083  * info.shape = self._shape
8084  * info.strides = self._strides # <<<<<<<<<<<<<<
8085  * info.suboffsets = NULL
8086  * info.itemsize = self.itemsize
8087  */
8088  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
8089  __pyx_t_7 = __pyx_v_self->_strides;
8090  __pyx_v_info->strides = __pyx_t_7;
8091 
8092  /* "View.MemoryView":199
8093  * info.shape = self._shape
8094  * info.strides = self._strides
8095  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8096  * info.itemsize = self.itemsize
8097  * info.readonly = 0
8098  */
8099  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
8100  __pyx_v_info->suboffsets = NULL;
8101 
8102  /* "View.MemoryView":200
8103  * info.strides = self._strides
8104  * info.suboffsets = NULL
8105  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8106  * info.readonly = 0
8107  *
8108  */
8109  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
8110  __pyx_t_5 = __pyx_v_self->itemsize;
8111  __pyx_v_info->itemsize = __pyx_t_5;
8112 
8113  /* "View.MemoryView":201
8114  * info.suboffsets = NULL
8115  * info.itemsize = self.itemsize
8116  * info.readonly = 0 # <<<<<<<<<<<<<<
8117  *
8118  * if flags & PyBUF_FORMAT:
8119  */
8120  __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
8121  __pyx_v_info->readonly = 0;
8122 
8123  /* "View.MemoryView":203
8124  * info.readonly = 0
8125  *
8126  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8127  * info.format = self.format
8128  * else:
8129  */
8130  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
8131  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8132  if (__pyx_t_1) {
8133 
8134  /* "View.MemoryView":204
8135  *
8136  * if flags & PyBUF_FORMAT:
8137  * info.format = self.format # <<<<<<<<<<<<<<
8138  * else:
8139  * info.format = NULL
8140  */
8141  __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
8142  __pyx_t_4 = __pyx_v_self->format;
8143  __pyx_v_info->format = __pyx_t_4;
8144 
8145  /* "View.MemoryView":203
8146  * info.readonly = 0
8147  *
8148  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8149  * info.format = self.format
8150  * else:
8151  */
8152  goto __pyx_L5;
8153  }
8154 
8155  /* "View.MemoryView":206
8156  * info.format = self.format
8157  * else:
8158  * info.format = NULL # <<<<<<<<<<<<<<
8159  *
8160  * info.obj = self
8161  */
8162  __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
8163  /*else*/ {
8164  __pyx_v_info->format = NULL;
8165  }
8166  __pyx_L5:;
8167 
8168  /* "View.MemoryView":208
8169  * info.format = NULL
8170  *
8171  * info.obj = self # <<<<<<<<<<<<<<
8172  *
8173  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8174  */
8175  __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
8176  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8177  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8178  __Pyx_GOTREF(__pyx_v_info->obj);
8179  __Pyx_DECREF(__pyx_v_info->obj);
8180  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8181 
8182  /* "View.MemoryView":186
8183  *
8184  * @cname('getbuffer')
8185  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8186  * cdef int bufmode = -1
8187  * if self.mode == u"c":
8188  */
8189 
8190  /* function exit code */
8191  __pyx_r = 0;
8192  goto __pyx_L0;
8193  __pyx_L1_error:;
8194  __Pyx_XDECREF(__pyx_t_3);
8195  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8196  __pyx_r = -1;
8197  if (__pyx_v_info->obj != NULL) {
8198  __Pyx_GOTREF(__pyx_v_info->obj);
8199  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8200  }
8201  goto __pyx_L2;
8202  __pyx_L0:;
8203  if (__pyx_v_info->obj == Py_None) {
8204  __Pyx_GOTREF(__pyx_v_info->obj);
8205  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8206  }
8207  __pyx_L2:;
8208  __Pyx_TraceReturn(Py_None, 0);
8209  __Pyx_RefNannyFinishContext();
8210  return __pyx_r;
8211 }
8212 
8213 /* "View.MemoryView":212
8214  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8215  *
8216  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8217  * if self.callback_free_data != NULL:
8218  * self.callback_free_data(self.data)
8219  */
8220 
8221 /* Python wrapper */
8222 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8223 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8224  __Pyx_RefNannyDeclarations
8225  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8226  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8227 
8228  /* function exit code */
8229  __Pyx_RefNannyFinishContext();
8230 }
8231 
8232 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8233  __Pyx_TraceDeclarations
8234  __Pyx_RefNannyDeclarations
8235  int __pyx_t_1;
8236  int __pyx_lineno = 0;
8237  const char *__pyx_filename = NULL;
8238  int __pyx_clineno = 0;
8239  __Pyx_RefNannySetupContext("__dealloc__", 0);
8240  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
8241 
8242  /* "View.MemoryView":213
8243  *
8244  * def __dealloc__(array self):
8245  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8246  * self.callback_free_data(self.data)
8247  * elif self.free_data:
8248  */
8249  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
8250  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8251  if (__pyx_t_1) {
8252 
8253  /* "View.MemoryView":214
8254  * def __dealloc__(array self):
8255  * if self.callback_free_data != NULL:
8256  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8257  * elif self.free_data:
8258  * if self.dtype_is_object:
8259  */
8260  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
8261  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8262 
8263  /* "View.MemoryView":213
8264  *
8265  * def __dealloc__(array self):
8266  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8267  * self.callback_free_data(self.data)
8268  * elif self.free_data:
8269  */
8270  goto __pyx_L3;
8271  }
8272 
8273  /* "View.MemoryView":215
8274  * if self.callback_free_data != NULL:
8275  * self.callback_free_data(self.data)
8276  * elif self.free_data: # <<<<<<<<<<<<<<
8277  * if self.dtype_is_object:
8278  * refcount_objects_in_slice(self.data, self._shape,
8279  */
8280  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
8281  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8282  if (__pyx_t_1) {
8283 
8284  /* "View.MemoryView":216
8285  * self.callback_free_data(self.data)
8286  * elif self.free_data:
8287  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8288  * refcount_objects_in_slice(self.data, self._shape,
8289  * self._strides, self.ndim, False)
8290  */
8291  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
8292  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8293  if (__pyx_t_1) {
8294 
8295  /* "View.MemoryView":217
8296  * elif self.free_data:
8297  * if self.dtype_is_object:
8298  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8299  * self._strides, self.ndim, False)
8300  * free(self.data)
8301  */
8302  __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
8303  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8304 
8305  /* "View.MemoryView":216
8306  * self.callback_free_data(self.data)
8307  * elif self.free_data:
8308  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8309  * refcount_objects_in_slice(self.data, self._shape,
8310  * self._strides, self.ndim, False)
8311  */
8312  }
8313 
8314  /* "View.MemoryView":219
8315  * refcount_objects_in_slice(self.data, self._shape,
8316  * self._strides, self.ndim, False)
8317  * free(self.data) # <<<<<<<<<<<<<<
8318  * PyObject_Free(self._shape)
8319  *
8320  */
8321  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8322  free(__pyx_v_self->data);
8323 
8324  /* "View.MemoryView":215
8325  * if self.callback_free_data != NULL:
8326  * self.callback_free_data(self.data)
8327  * elif self.free_data: # <<<<<<<<<<<<<<
8328  * if self.dtype_is_object:
8329  * refcount_objects_in_slice(self.data, self._shape,
8330  */
8331  }
8332  __pyx_L3:;
8333 
8334  /* "View.MemoryView":220
8335  * self._strides, self.ndim, False)
8336  * free(self.data)
8337  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8338  *
8339  * @property
8340  */
8341  __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
8342  PyObject_Free(__pyx_v_self->_shape);
8343 
8344  /* "View.MemoryView":212
8345  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8346  *
8347  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8348  * if self.callback_free_data != NULL:
8349  * self.callback_free_data(self.data)
8350  */
8351 
8352  /* function exit code */
8353  goto __pyx_L0;
8354  __pyx_L1_error:;
8355  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8356  __pyx_L0:;
8357  __Pyx_TraceReturn(Py_None, 0);
8358  __Pyx_RefNannyFinishContext();
8359 }
8360 
8361 /* "View.MemoryView":223
8362  *
8363  * @property
8364  * def memview(self): # <<<<<<<<<<<<<<
8365  * return self.get_memview()
8366  *
8367  */
8368 
8369 /* Python wrapper */
8370 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8371 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8372  PyObject *__pyx_r = 0;
8373  __Pyx_RefNannyDeclarations
8374  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8375  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8376 
8377  /* function exit code */
8378  __Pyx_RefNannyFinishContext();
8379  return __pyx_r;
8380 }
8381 
8382 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8383  PyObject *__pyx_r = NULL;
8384  __Pyx_TraceDeclarations
8385  __Pyx_RefNannyDeclarations
8386  PyObject *__pyx_t_1 = NULL;
8387  int __pyx_lineno = 0;
8388  const char *__pyx_filename = NULL;
8389  int __pyx_clineno = 0;
8390  __Pyx_RefNannySetupContext("__get__", 0);
8391  __Pyx_TraceCall("__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
8392 
8393  /* "View.MemoryView":224
8394  * @property
8395  * def memview(self):
8396  * return self.get_memview() # <<<<<<<<<<<<<<
8397  *
8398  * @cname('get_memview')
8399  */
8400  __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
8401  __Pyx_XDECREF(__pyx_r);
8402  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
8403  __Pyx_GOTREF(__pyx_t_1);
8404  __pyx_r = __pyx_t_1;
8405  __pyx_t_1 = 0;
8406  goto __pyx_L0;
8407 
8408  /* "View.MemoryView":223
8409  *
8410  * @property
8411  * def memview(self): # <<<<<<<<<<<<<<
8412  * return self.get_memview()
8413  *
8414  */
8415 
8416  /* function exit code */
8417  __pyx_L1_error:;
8418  __Pyx_XDECREF(__pyx_t_1);
8419  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8420  __pyx_r = NULL;
8421  __pyx_L0:;
8422  __Pyx_XGIVEREF(__pyx_r);
8423  __Pyx_TraceReturn(__pyx_r, 0);
8424  __Pyx_RefNannyFinishContext();
8425  return __pyx_r;
8426 }
8427 
8428 /* "View.MemoryView":227
8429  *
8430  * @cname('get_memview')
8431  * cdef get_memview(self): # <<<<<<<<<<<<<<
8432  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8433  * return memoryview(self, flags, self.dtype_is_object)
8434  */
8435 
8436 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8437  int __pyx_v_flags;
8438  PyObject *__pyx_r = NULL;
8439  __Pyx_TraceDeclarations
8440  __Pyx_RefNannyDeclarations
8441  PyObject *__pyx_t_1 = NULL;
8442  PyObject *__pyx_t_2 = NULL;
8443  PyObject *__pyx_t_3 = NULL;
8444  int __pyx_lineno = 0;
8445  const char *__pyx_filename = NULL;
8446  int __pyx_clineno = 0;
8447  __Pyx_RefNannySetupContext("get_memview", 0);
8448  __Pyx_TraceCall("get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
8449 
8450  /* "View.MemoryView":228
8451  * @cname('get_memview')
8452  * cdef get_memview(self):
8453  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8454  * return memoryview(self, flags, self.dtype_is_object)
8455  *
8456  */
8457  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8458  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8459 
8460  /* "View.MemoryView":229
8461  * cdef get_memview(self):
8462  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8463  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8464  *
8465  * def __len__(self):
8466  */
8467  __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
8468  __Pyx_XDECREF(__pyx_r);
8469  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8470  __Pyx_GOTREF(__pyx_t_1);
8471  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8472  __Pyx_GOTREF(__pyx_t_2);
8473  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
8474  __Pyx_GOTREF(__pyx_t_3);
8475  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8476  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8477  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8478  __Pyx_GIVEREF(__pyx_t_1);
8479  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8480  __Pyx_GIVEREF(__pyx_t_2);
8481  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8482  __pyx_t_1 = 0;
8483  __pyx_t_2 = 0;
8484  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8485  __Pyx_GOTREF(__pyx_t_2);
8486  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8487  __pyx_r = __pyx_t_2;
8488  __pyx_t_2 = 0;
8489  goto __pyx_L0;
8490 
8491  /* "View.MemoryView":227
8492  *
8493  * @cname('get_memview')
8494  * cdef get_memview(self): # <<<<<<<<<<<<<<
8495  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8496  * return memoryview(self, flags, self.dtype_is_object)
8497  */
8498 
8499  /* function exit code */
8500  __pyx_L1_error:;
8501  __Pyx_XDECREF(__pyx_t_1);
8502  __Pyx_XDECREF(__pyx_t_2);
8503  __Pyx_XDECREF(__pyx_t_3);
8504  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8505  __pyx_r = 0;
8506  __pyx_L0:;
8507  __Pyx_XGIVEREF(__pyx_r);
8508  __Pyx_TraceReturn(__pyx_r, 0);
8509  __Pyx_RefNannyFinishContext();
8510  return __pyx_r;
8511 }
8512 
8513 /* "View.MemoryView":231
8514  * return memoryview(self, flags, self.dtype_is_object)
8515  *
8516  * def __len__(self): # <<<<<<<<<<<<<<
8517  * return self._shape[0]
8518  *
8519  */
8520 
8521 /* Python wrapper */
8522 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8523 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8524  Py_ssize_t __pyx_r;
8525  __Pyx_RefNannyDeclarations
8526  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
8527  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
8528 
8529  /* function exit code */
8530  __Pyx_RefNannyFinishContext();
8531  return __pyx_r;
8532 }
8533 
8534 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
8535  Py_ssize_t __pyx_r;
8536  __Pyx_TraceDeclarations
8537  __Pyx_RefNannyDeclarations
8538  int __pyx_lineno = 0;
8539  const char *__pyx_filename = NULL;
8540  int __pyx_clineno = 0;
8541  __Pyx_RefNannySetupContext("__len__", 0);
8542  __Pyx_TraceCall("__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
8543 
8544  /* "View.MemoryView":232
8545  *
8546  * def __len__(self):
8547  * return self._shape[0] # <<<<<<<<<<<<<<
8548  *
8549  * def __getattr__(self, attr):
8550  */
8551  __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
8552  __pyx_r = (__pyx_v_self->_shape[0]);
8553  goto __pyx_L0;
8554 
8555  /* "View.MemoryView":231
8556  * return memoryview(self, flags, self.dtype_is_object)
8557  *
8558  * def __len__(self): # <<<<<<<<<<<<<<
8559  * return self._shape[0]
8560  *
8561  */
8562 
8563  /* function exit code */
8564  __pyx_L1_error:;
8565  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8566  __pyx_r = -1;
8567  __pyx_L0:;
8568  __Pyx_TraceReturn(Py_None, 0);
8569  __Pyx_RefNannyFinishContext();
8570  return __pyx_r;
8571 }
8572 
8573 /* "View.MemoryView":234
8574  * return self._shape[0]
8575  *
8576  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8577  * return getattr(self.memview, attr)
8578  *
8579  */
8580 
8581 /* Python wrapper */
8582 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
8583 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8584  PyObject *__pyx_r = 0;
8585  __Pyx_RefNannyDeclarations
8586  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
8587  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8588 
8589  /* function exit code */
8590  __Pyx_RefNannyFinishContext();
8591  return __pyx_r;
8592 }
8593 
8594 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8595  PyObject *__pyx_r = NULL;
8596  __Pyx_TraceDeclarations
8597  __Pyx_RefNannyDeclarations
8598  PyObject *__pyx_t_1 = NULL;
8599  PyObject *__pyx_t_2 = NULL;
8600  int __pyx_lineno = 0;
8601  const char *__pyx_filename = NULL;
8602  int __pyx_clineno = 0;
8603  __Pyx_RefNannySetupContext("__getattr__", 0);
8604  __Pyx_TraceCall("__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
8605 
8606  /* "View.MemoryView":235
8607  *
8608  * def __getattr__(self, attr):
8609  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
8610  *
8611  * def __getitem__(self, item):
8612  */
8613  __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
8614  __Pyx_XDECREF(__pyx_r);
8615  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
8616  __Pyx_GOTREF(__pyx_t_1);
8617  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
8618  __Pyx_GOTREF(__pyx_t_2);
8619  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8620  __pyx_r = __pyx_t_2;
8621  __pyx_t_2 = 0;
8622  goto __pyx_L0;
8623 
8624  /* "View.MemoryView":234
8625  * return self._shape[0]
8626  *
8627  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8628  * return getattr(self.memview, attr)
8629  *
8630  */
8631 
8632  /* function exit code */
8633  __pyx_L1_error:;
8634  __Pyx_XDECREF(__pyx_t_1);
8635  __Pyx_XDECREF(__pyx_t_2);
8636  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8637  __pyx_r = NULL;
8638  __pyx_L0:;
8639  __Pyx_XGIVEREF(__pyx_r);
8640  __Pyx_TraceReturn(__pyx_r, 0);
8641  __Pyx_RefNannyFinishContext();
8642  return __pyx_r;
8643 }
8644 
8645 /* "View.MemoryView":237
8646  * return getattr(self.memview, attr)
8647  *
8648  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8649  * return self.memview[item]
8650  *
8651  */
8652 
8653 /* Python wrapper */
8654 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
8655 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8656  PyObject *__pyx_r = 0;
8657  __Pyx_RefNannyDeclarations
8658  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8659  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8660 
8661  /* function exit code */
8662  __Pyx_RefNannyFinishContext();
8663  return __pyx_r;
8664 }
8665 
8666 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8667  PyObject *__pyx_r = NULL;
8668  __Pyx_TraceDeclarations
8669  __Pyx_RefNannyDeclarations
8670  PyObject *__pyx_t_1 = NULL;
8671  PyObject *__pyx_t_2 = NULL;
8672  int __pyx_lineno = 0;
8673  const char *__pyx_filename = NULL;
8674  int __pyx_clineno = 0;
8675  __Pyx_RefNannySetupContext("__getitem__", 0);
8676  __Pyx_TraceCall("__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
8677 
8678  /* "View.MemoryView":238
8679  *
8680  * def __getitem__(self, item):
8681  * return self.memview[item] # <<<<<<<<<<<<<<
8682  *
8683  * def __setitem__(self, item, value):
8684  */
8685  __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
8686  __Pyx_XDECREF(__pyx_r);
8687  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
8688  __Pyx_GOTREF(__pyx_t_1);
8689  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
8690  __Pyx_GOTREF(__pyx_t_2);
8691  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8692  __pyx_r = __pyx_t_2;
8693  __pyx_t_2 = 0;
8694  goto __pyx_L0;
8695 
8696  /* "View.MemoryView":237
8697  * return getattr(self.memview, attr)
8698  *
8699  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8700  * return self.memview[item]
8701  *
8702  */
8703 
8704  /* function exit code */
8705  __pyx_L1_error:;
8706  __Pyx_XDECREF(__pyx_t_1);
8707  __Pyx_XDECREF(__pyx_t_2);
8708  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8709  __pyx_r = NULL;
8710  __pyx_L0:;
8711  __Pyx_XGIVEREF(__pyx_r);
8712  __Pyx_TraceReturn(__pyx_r, 0);
8713  __Pyx_RefNannyFinishContext();
8714  return __pyx_r;
8715 }
8716 
8717 /* "View.MemoryView":240
8718  * return self.memview[item]
8719  *
8720  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8721  * self.memview[item] = value
8722  *
8723  */
8724 
8725 /* Python wrapper */
8726 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
8727 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8728  int __pyx_r;
8729  __Pyx_RefNannyDeclarations
8730  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8731  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8732 
8733  /* function exit code */
8734  __Pyx_RefNannyFinishContext();
8735  return __pyx_r;
8736 }
8737 
8738 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8739  int __pyx_r;
8740  __Pyx_TraceDeclarations
8741  __Pyx_RefNannyDeclarations
8742  PyObject *__pyx_t_1 = NULL;
8743  int __pyx_lineno = 0;
8744  const char *__pyx_filename = NULL;
8745  int __pyx_clineno = 0;
8746  __Pyx_RefNannySetupContext("__setitem__", 0);
8747  __Pyx_TraceCall("__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
8748 
8749  /* "View.MemoryView":241
8750  *
8751  * def __setitem__(self, item, value):
8752  * self.memview[item] = value # <<<<<<<<<<<<<<
8753  *
8754  *
8755  */
8756  __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
8757  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
8758  __Pyx_GOTREF(__pyx_t_1);
8759  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
8760  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761 
8762  /* "View.MemoryView":240
8763  * return self.memview[item]
8764  *
8765  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8766  * self.memview[item] = value
8767  *
8768  */
8769 
8770  /* function exit code */
8771  __pyx_r = 0;
8772  goto __pyx_L0;
8773  __pyx_L1_error:;
8774  __Pyx_XDECREF(__pyx_t_1);
8775  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8776  __pyx_r = -1;
8777  __pyx_L0:;
8778  __Pyx_TraceReturn(Py_None, 0);
8779  __Pyx_RefNannyFinishContext();
8780  return __pyx_r;
8781 }
8782 
8783 /* "(tree fragment)":1
8784  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8785  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8786  * def __setstate_cython__(self, __pyx_state):
8787  */
8788 
8789 /* Python wrapper */
8790 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8791 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8792 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8793  PyObject *__pyx_r = 0;
8794  __Pyx_RefNannyDeclarations
8795  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8796  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
8797 
8798  /* function exit code */
8799  __Pyx_RefNannyFinishContext();
8800  return __pyx_r;
8801 }
8802 
8803 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
8804  PyObject *__pyx_r = NULL;
8805  __Pyx_TraceDeclarations
8806  __Pyx_RefNannyDeclarations
8807  PyObject *__pyx_t_1 = NULL;
8808  int __pyx_lineno = 0;
8809  const char *__pyx_filename = NULL;
8810  int __pyx_clineno = 0;
8811  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8812  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8813 
8814  /* "(tree fragment)":2
8815  * def __reduce_cython__(self):
8816  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8817  * def __setstate_cython__(self, __pyx_state):
8818  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8819  */
8820  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8821  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8822  __Pyx_GOTREF(__pyx_t_1);
8823  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8824  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8825  __PYX_ERR(1, 2, __pyx_L1_error)
8826 
8827  /* "(tree fragment)":1
8828  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8829  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8830  * def __setstate_cython__(self, __pyx_state):
8831  */
8832 
8833  /* function exit code */
8834  __pyx_L1_error:;
8835  __Pyx_XDECREF(__pyx_t_1);
8836  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8837  __pyx_r = NULL;
8838  __Pyx_XGIVEREF(__pyx_r);
8839  __Pyx_TraceReturn(__pyx_r, 0);
8840  __Pyx_RefNannyFinishContext();
8841  return __pyx_r;
8842 }
8843 
8844 /* "(tree fragment)":3
8845  * def __reduce_cython__(self):
8846  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8847  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8848  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8849  */
8850 
8851 /* Python wrapper */
8852 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8853 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8854 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8855  PyObject *__pyx_r = 0;
8856  __Pyx_RefNannyDeclarations
8857  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8858  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8859 
8860  /* function exit code */
8861  __Pyx_RefNannyFinishContext();
8862  return __pyx_r;
8863 }
8864 
8865 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8866  PyObject *__pyx_r = NULL;
8867  __Pyx_TraceDeclarations
8868  __Pyx_RefNannyDeclarations
8869  PyObject *__pyx_t_1 = NULL;
8870  int __pyx_lineno = 0;
8871  const char *__pyx_filename = NULL;
8872  int __pyx_clineno = 0;
8873  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8874  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8875 
8876  /* "(tree fragment)":4
8877  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8878  * def __setstate_cython__(self, __pyx_state):
8879  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8880  */
8881  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8882  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8883  __Pyx_GOTREF(__pyx_t_1);
8884  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8885  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8886  __PYX_ERR(1, 4, __pyx_L1_error)
8887 
8888  /* "(tree fragment)":3
8889  * def __reduce_cython__(self):
8890  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8891  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8892  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8893  */
8894 
8895  /* function exit code */
8896  __pyx_L1_error:;
8897  __Pyx_XDECREF(__pyx_t_1);
8898  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8899  __pyx_r = NULL;
8900  __Pyx_XGIVEREF(__pyx_r);
8901  __Pyx_TraceReturn(__pyx_r, 0);
8902  __Pyx_RefNannyFinishContext();
8903  return __pyx_r;
8904 }
8905 
8906 /* "View.MemoryView":245
8907  *
8908  * @cname("__pyx_array_new")
8909  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8910  * char *mode, char *buf):
8911  * cdef array result
8912  */
8913 
8914 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
8915  struct __pyx_array_obj *__pyx_v_result = 0;
8916  struct __pyx_array_obj *__pyx_r = NULL;
8917  __Pyx_TraceDeclarations
8918  __Pyx_RefNannyDeclarations
8919  int __pyx_t_1;
8920  PyObject *__pyx_t_2 = NULL;
8921  PyObject *__pyx_t_3 = NULL;
8922  PyObject *__pyx_t_4 = NULL;
8923  PyObject *__pyx_t_5 = NULL;
8924  int __pyx_lineno = 0;
8925  const char *__pyx_filename = NULL;
8926  int __pyx_clineno = 0;
8927  __Pyx_RefNannySetupContext("array_cwrapper", 0);
8928  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8929 
8930  /* "View.MemoryView":249
8931  * cdef array result
8932  *
8933  * if buf == NULL: # <<<<<<<<<<<<<<
8934  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8935  * else:
8936  */
8937  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8938  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8939  if (__pyx_t_1) {
8940 
8941  /* "View.MemoryView":250
8942  *
8943  * if buf == NULL:
8944  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
8945  * else:
8946  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8947  */
8948  __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8949  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8950  __Pyx_GOTREF(__pyx_t_2);
8951  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8952  __Pyx_GOTREF(__pyx_t_3);
8953  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8954  __Pyx_GOTREF(__pyx_t_4);
8955  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8956  __Pyx_GOTREF(__pyx_t_5);
8957  __Pyx_INCREF(__pyx_v_shape);
8958  __Pyx_GIVEREF(__pyx_v_shape);
8959  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8960  __Pyx_GIVEREF(__pyx_t_2);
8961  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8962  __Pyx_GIVEREF(__pyx_t_3);
8963  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8964  __Pyx_GIVEREF(__pyx_t_4);
8965  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8966  __pyx_t_2 = 0;
8967  __pyx_t_3 = 0;
8968  __pyx_t_4 = 0;
8969  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8970  __Pyx_GOTREF(__pyx_t_4);
8971  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8972  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
8973  __pyx_t_4 = 0;
8974 
8975  /* "View.MemoryView":249
8976  * cdef array result
8977  *
8978  * if buf == NULL: # <<<<<<<<<<<<<<
8979  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8980  * else:
8981  */
8982  goto __pyx_L3;
8983  }
8984 
8985  /* "View.MemoryView":252
8986  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8987  * else:
8988  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8989  * allocate_buffer=False)
8990  * result.data = buf
8991  */
8992  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8993  /*else*/ {
8994  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8995  __Pyx_GOTREF(__pyx_t_4);
8996  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8997  __Pyx_GOTREF(__pyx_t_5);
8998  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8999  __Pyx_GOTREF(__pyx_t_3);
9000  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
9001  __Pyx_GOTREF(__pyx_t_2);
9002  __Pyx_INCREF(__pyx_v_shape);
9003  __Pyx_GIVEREF(__pyx_v_shape);
9004  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9005  __Pyx_GIVEREF(__pyx_t_4);
9006  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9007  __Pyx_GIVEREF(__pyx_t_5);
9008  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9009  __Pyx_GIVEREF(__pyx_t_3);
9010  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9011  __pyx_t_4 = 0;
9012  __pyx_t_5 = 0;
9013  __pyx_t_3 = 0;
9014 
9015  /* "View.MemoryView":253
9016  * else:
9017  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9018  * allocate_buffer=False) # <<<<<<<<<<<<<<
9019  * result.data = buf
9020  *
9021  */
9022  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
9023  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
9024  __Pyx_GOTREF(__pyx_t_3);
9025  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
9026 
9027  /* "View.MemoryView":252
9028  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9029  * else:
9030  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9031  * allocate_buffer=False)
9032  * result.data = buf
9033  */
9034  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
9035  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
9036  __Pyx_GOTREF(__pyx_t_5);
9037  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9038  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9039  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9040  __pyx_t_5 = 0;
9041 
9042  /* "View.MemoryView":254
9043  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9044  * allocate_buffer=False)
9045  * result.data = buf # <<<<<<<<<<<<<<
9046  *
9047  * return result
9048  */
9049  __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
9050  __pyx_v_result->data = __pyx_v_buf;
9051  }
9052  __pyx_L3:;
9053 
9054  /* "View.MemoryView":256
9055  * result.data = buf
9056  *
9057  * return result # <<<<<<<<<<<<<<
9058  *
9059  *
9060  */
9061  __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
9062  __Pyx_XDECREF(((PyObject *)__pyx_r));
9063  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9064  __pyx_r = __pyx_v_result;
9065  goto __pyx_L0;
9066 
9067  /* "View.MemoryView":245
9068  *
9069  * @cname("__pyx_array_new")
9070  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9071  * char *mode, char *buf):
9072  * cdef array result
9073  */
9074 
9075  /* function exit code */
9076  __pyx_L1_error:;
9077  __Pyx_XDECREF(__pyx_t_2);
9078  __Pyx_XDECREF(__pyx_t_3);
9079  __Pyx_XDECREF(__pyx_t_4);
9080  __Pyx_XDECREF(__pyx_t_5);
9081  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9082  __pyx_r = 0;
9083  __pyx_L0:;
9084  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9085  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9086  __Pyx_TraceReturn(__pyx_r, 0);
9087  __Pyx_RefNannyFinishContext();
9088  return __pyx_r;
9089 }
9090 
9091 /* "View.MemoryView":282
9092  * cdef class Enum(object):
9093  * cdef object name
9094  * def __init__(self, name): # <<<<<<<<<<<<<<
9095  * self.name = name
9096  * def __repr__(self):
9097  */
9098 
9099 /* Python wrapper */
9100 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9101 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9102  PyObject *__pyx_v_name = 0;
9103  int __pyx_lineno = 0;
9104  const char *__pyx_filename = NULL;
9105  int __pyx_clineno = 0;
9106  int __pyx_r;
9107  __Pyx_RefNannyDeclarations
9108  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9109  {
9110  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9111  PyObject* values[1] = {0};
9112  if (unlikely(__pyx_kwds)) {
9113  Py_ssize_t kw_args;
9114  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9115  switch (pos_args) {
9116  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9117  CYTHON_FALLTHROUGH;
9118  case 0: break;
9119  default: goto __pyx_L5_argtuple_error;
9120  }
9121  kw_args = PyDict_Size(__pyx_kwds);
9122  switch (pos_args) {
9123  case 0:
9124  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9125  else goto __pyx_L5_argtuple_error;
9126  }
9127  if (unlikely(kw_args > 0)) {
9128  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
9129  }
9130  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9131  goto __pyx_L5_argtuple_error;
9132  } else {
9133  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9134  }
9135  __pyx_v_name = values[0];
9136  }
9137  goto __pyx_L4_argument_unpacking_done;
9138  __pyx_L5_argtuple_error:;
9139  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
9140  __pyx_L3_error:;
9141  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9142  __Pyx_RefNannyFinishContext();
9143  return -1;
9144  __pyx_L4_argument_unpacking_done:;
9145  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9146 
9147  /* function exit code */
9148  __Pyx_RefNannyFinishContext();
9149  return __pyx_r;
9150 }
9151 
9152 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9153  int __pyx_r;
9154  __Pyx_TraceDeclarations
9155  __Pyx_RefNannyDeclarations
9156  int __pyx_lineno = 0;
9157  const char *__pyx_filename = NULL;
9158  int __pyx_clineno = 0;
9159  __Pyx_RefNannySetupContext("__init__", 0);
9160  __Pyx_TraceCall("__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
9161 
9162  /* "View.MemoryView":283
9163  * cdef object name
9164  * def __init__(self, name):
9165  * self.name = name # <<<<<<<<<<<<<<
9166  * def __repr__(self):
9167  * return self.name
9168  */
9169  __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
9170  __Pyx_INCREF(__pyx_v_name);
9171  __Pyx_GIVEREF(__pyx_v_name);
9172  __Pyx_GOTREF(__pyx_v_self->name);
9173  __Pyx_DECREF(__pyx_v_self->name);
9174  __pyx_v_self->name = __pyx_v_name;
9175 
9176  /* "View.MemoryView":282
9177  * cdef class Enum(object):
9178  * cdef object name
9179  * def __init__(self, name): # <<<<<<<<<<<<<<
9180  * self.name = name
9181  * def __repr__(self):
9182  */
9183 
9184  /* function exit code */
9185  __pyx_r = 0;
9186  goto __pyx_L0;
9187  __pyx_L1_error:;
9188  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9189  __pyx_r = -1;
9190  __pyx_L0:;
9191  __Pyx_TraceReturn(Py_None, 0);
9192  __Pyx_RefNannyFinishContext();
9193  return __pyx_r;
9194 }
9195 
9196 /* "View.MemoryView":284
9197  * def __init__(self, name):
9198  * self.name = name
9199  * def __repr__(self): # <<<<<<<<<<<<<<
9200  * return self.name
9201  *
9202  */
9203 
9204 /* Python wrapper */
9205 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9206 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9207  PyObject *__pyx_r = 0;
9208  __Pyx_RefNannyDeclarations
9209  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9210  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9211 
9212  /* function exit code */
9213  __Pyx_RefNannyFinishContext();
9214  return __pyx_r;
9215 }
9216 
9217 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9218  PyObject *__pyx_r = NULL;
9219  __Pyx_TraceDeclarations
9220  __Pyx_RefNannyDeclarations
9221  int __pyx_lineno = 0;
9222  const char *__pyx_filename = NULL;
9223  int __pyx_clineno = 0;
9224  __Pyx_RefNannySetupContext("__repr__", 0);
9225  __Pyx_TraceCall("__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
9226 
9227  /* "View.MemoryView":285
9228  * self.name = name
9229  * def __repr__(self):
9230  * return self.name # <<<<<<<<<<<<<<
9231  *
9232  * cdef generic = Enum("<strided and direct or indirect>")
9233  */
9234  __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
9235  __Pyx_XDECREF(__pyx_r);
9236  __Pyx_INCREF(__pyx_v_self->name);
9237  __pyx_r = __pyx_v_self->name;
9238  goto __pyx_L0;
9239 
9240  /* "View.MemoryView":284
9241  * def __init__(self, name):
9242  * self.name = name
9243  * def __repr__(self): # <<<<<<<<<<<<<<
9244  * return self.name
9245  *
9246  */
9247 
9248  /* function exit code */
9249  __pyx_L1_error:;
9250  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9251  __pyx_r = NULL;
9252  __pyx_L0:;
9253  __Pyx_XGIVEREF(__pyx_r);
9254  __Pyx_TraceReturn(__pyx_r, 0);
9255  __Pyx_RefNannyFinishContext();
9256  return __pyx_r;
9257 }
9258 
9259 /* "(tree fragment)":1
9260  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9261  * cdef tuple state
9262  * cdef object _dict
9263  */
9264 
9265 /* Python wrapper */
9266 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9267 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9268 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9269  PyObject *__pyx_r = 0;
9270  __Pyx_RefNannyDeclarations
9271  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9272  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9273 
9274  /* function exit code */
9275  __Pyx_RefNannyFinishContext();
9276  return __pyx_r;
9277 }
9278 
9279 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9280  PyObject *__pyx_v_state = 0;
9281  PyObject *__pyx_v__dict = 0;
9282  int __pyx_v_use_setstate;
9283  PyObject *__pyx_r = NULL;
9284  __Pyx_TraceDeclarations
9285  __Pyx_RefNannyDeclarations
9286  PyObject *__pyx_t_1 = NULL;
9287  int __pyx_t_2;
9288  int __pyx_t_3;
9289  PyObject *__pyx_t_4 = NULL;
9290  PyObject *__pyx_t_5 = NULL;
9291  int __pyx_lineno = 0;
9292  const char *__pyx_filename = NULL;
9293  int __pyx_clineno = 0;
9294  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9295  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9296 
9297  /* "(tree fragment)":5
9298  * cdef object _dict
9299  * cdef bint use_setstate
9300  * state = (self.name,) # <<<<<<<<<<<<<<
9301  * _dict = getattr(self, '__dict__', None)
9302  * if _dict is not None:
9303  */
9304  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
9305  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9306  __Pyx_GOTREF(__pyx_t_1);
9307  __Pyx_INCREF(__pyx_v_self->name);
9308  __Pyx_GIVEREF(__pyx_v_self->name);
9309  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9310  __pyx_v_state = ((PyObject*)__pyx_t_1);
9311  __pyx_t_1 = 0;
9312 
9313  /* "(tree fragment)":6
9314  * cdef bint use_setstate
9315  * state = (self.name,)
9316  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9317  * if _dict is not None:
9318  * state += (_dict,)
9319  */
9320  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9321  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9322  __Pyx_GOTREF(__pyx_t_1);
9323  __pyx_v__dict = __pyx_t_1;
9324  __pyx_t_1 = 0;
9325 
9326  /* "(tree fragment)":7
9327  * state = (self.name,)
9328  * _dict = getattr(self, '__dict__', None)
9329  * if _dict is not None: # <<<<<<<<<<<<<<
9330  * state += (_dict,)
9331  * use_setstate = True
9332  */
9333  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9334  __pyx_t_2 = (__pyx_v__dict != Py_None);
9335  __pyx_t_3 = (__pyx_t_2 != 0);
9336  if (__pyx_t_3) {
9337 
9338  /* "(tree fragment)":8
9339  * _dict = getattr(self, '__dict__', None)
9340  * if _dict is not None:
9341  * state += (_dict,) # <<<<<<<<<<<<<<
9342  * use_setstate = True
9343  * else:
9344  */
9345  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9346  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9347  __Pyx_GOTREF(__pyx_t_1);
9348  __Pyx_INCREF(__pyx_v__dict);
9349  __Pyx_GIVEREF(__pyx_v__dict);
9350  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9351  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9352  __Pyx_GOTREF(__pyx_t_4);
9353  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9354  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9355  __pyx_t_4 = 0;
9356 
9357  /* "(tree fragment)":9
9358  * if _dict is not None:
9359  * state += (_dict,)
9360  * use_setstate = True # <<<<<<<<<<<<<<
9361  * else:
9362  * use_setstate = self.name is not None
9363  */
9364  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9365  __pyx_v_use_setstate = 1;
9366 
9367  /* "(tree fragment)":7
9368  * state = (self.name,)
9369  * _dict = getattr(self, '__dict__', None)
9370  * if _dict is not None: # <<<<<<<<<<<<<<
9371  * state += (_dict,)
9372  * use_setstate = True
9373  */
9374  goto __pyx_L3;
9375  }
9376 
9377  /* "(tree fragment)":11
9378  * use_setstate = True
9379  * else:
9380  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9381  * if use_setstate:
9382  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9383  */
9384  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9385  /*else*/ {
9386  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9387  __pyx_v_use_setstate = __pyx_t_3;
9388  }
9389  __pyx_L3:;
9390 
9391  /* "(tree fragment)":12
9392  * else:
9393  * use_setstate = self.name is not None
9394  * if use_setstate: # <<<<<<<<<<<<<<
9395  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9396  * else:
9397  */
9398  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9399  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9400  if (__pyx_t_3) {
9401 
9402  /* "(tree fragment)":13
9403  * use_setstate = self.name is not None
9404  * if use_setstate:
9405  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9406  * else:
9407  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9408  */
9409  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9410  __Pyx_XDECREF(__pyx_r);
9411  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9412  __Pyx_GOTREF(__pyx_t_4);
9413  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9414  __Pyx_GOTREF(__pyx_t_1);
9415  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9416  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9417  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9418  __Pyx_INCREF(__pyx_int_184977713);
9419  __Pyx_GIVEREF(__pyx_int_184977713);
9420  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9421  __Pyx_INCREF(Py_None);
9422  __Pyx_GIVEREF(Py_None);
9423  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9424  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9425  __Pyx_GOTREF(__pyx_t_5);
9426  __Pyx_GIVEREF(__pyx_t_4);
9427  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9428  __Pyx_GIVEREF(__pyx_t_1);
9429  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9430  __Pyx_INCREF(__pyx_v_state);
9431  __Pyx_GIVEREF(__pyx_v_state);
9432  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9433  __pyx_t_4 = 0;
9434  __pyx_t_1 = 0;
9435  __pyx_r = __pyx_t_5;
9436  __pyx_t_5 = 0;
9437  goto __pyx_L0;
9438 
9439  /* "(tree fragment)":12
9440  * else:
9441  * use_setstate = self.name is not None
9442  * if use_setstate: # <<<<<<<<<<<<<<
9443  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9444  * else:
9445  */
9446  }
9447 
9448  /* "(tree fragment)":15
9449  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9450  * else:
9451  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9452  * def __setstate_cython__(self, __pyx_state):
9453  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9454  */
9455  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9456  /*else*/ {
9457  __Pyx_XDECREF(__pyx_r);
9458  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9459  __Pyx_GOTREF(__pyx_t_5);
9460  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9461  __Pyx_GOTREF(__pyx_t_1);
9462  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9463  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9464  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9465  __Pyx_INCREF(__pyx_int_184977713);
9466  __Pyx_GIVEREF(__pyx_int_184977713);
9467  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9468  __Pyx_INCREF(__pyx_v_state);
9469  __Pyx_GIVEREF(__pyx_v_state);
9470  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9471  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9472  __Pyx_GOTREF(__pyx_t_4);
9473  __Pyx_GIVEREF(__pyx_t_5);
9474  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9475  __Pyx_GIVEREF(__pyx_t_1);
9476  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9477  __pyx_t_5 = 0;
9478  __pyx_t_1 = 0;
9479  __pyx_r = __pyx_t_4;
9480  __pyx_t_4 = 0;
9481  goto __pyx_L0;
9482  }
9483 
9484  /* "(tree fragment)":1
9485  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9486  * cdef tuple state
9487  * cdef object _dict
9488  */
9489 
9490  /* function exit code */
9491  __pyx_L1_error:;
9492  __Pyx_XDECREF(__pyx_t_1);
9493  __Pyx_XDECREF(__pyx_t_4);
9494  __Pyx_XDECREF(__pyx_t_5);
9495  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9496  __pyx_r = NULL;
9497  __pyx_L0:;
9498  __Pyx_XDECREF(__pyx_v_state);
9499  __Pyx_XDECREF(__pyx_v__dict);
9500  __Pyx_XGIVEREF(__pyx_r);
9501  __Pyx_TraceReturn(__pyx_r, 0);
9502  __Pyx_RefNannyFinishContext();
9503  return __pyx_r;
9504 }
9505 
9506 /* "(tree fragment)":16
9507  * else:
9508  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9509  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9510  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9511  */
9512 
9513 /* Python wrapper */
9514 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9515 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9516 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9517  PyObject *__pyx_r = 0;
9518  __Pyx_RefNannyDeclarations
9519  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9520  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9521 
9522  /* function exit code */
9523  __Pyx_RefNannyFinishContext();
9524  return __pyx_r;
9525 }
9526 
9527 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9528  PyObject *__pyx_r = NULL;
9529  __Pyx_TraceDeclarations
9530  __Pyx_RefNannyDeclarations
9531  PyObject *__pyx_t_1 = NULL;
9532  int __pyx_lineno = 0;
9533  const char *__pyx_filename = NULL;
9534  int __pyx_clineno = 0;
9535  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9536  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9537 
9538  /* "(tree fragment)":17
9539  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9540  * def __setstate_cython__(self, __pyx_state):
9541  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9542  */
9543  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9544  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9545  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9546  __Pyx_GOTREF(__pyx_t_1);
9547  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9548 
9549  /* "(tree fragment)":16
9550  * else:
9551  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9552  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9553  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9554  */
9555 
9556  /* function exit code */
9557  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9558  goto __pyx_L0;
9559  __pyx_L1_error:;
9560  __Pyx_XDECREF(__pyx_t_1);
9561  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9562  __pyx_r = NULL;
9563  __pyx_L0:;
9564  __Pyx_XGIVEREF(__pyx_r);
9565  __Pyx_TraceReturn(__pyx_r, 0);
9566  __Pyx_RefNannyFinishContext();
9567  return __pyx_r;
9568 }
9569 
9570 /* "View.MemoryView":299
9571  *
9572  * @cname('__pyx_align_pointer')
9573  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9574  * "Align pointer memory on a given boundary"
9575  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9576  */
9577 
9578 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9579  Py_intptr_t __pyx_v_aligned_p;
9580  size_t __pyx_v_offset;
9581  void *__pyx_r;
9582  __Pyx_TraceDeclarations
9583  int __pyx_t_1;
9584  int __pyx_lineno = 0;
9585  const char *__pyx_filename = NULL;
9586  int __pyx_clineno = 0;
9587  __Pyx_TraceCall("align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
9588 
9589  /* "View.MemoryView":301
9590  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9591  * "Align pointer memory on a given boundary"
9592  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9593  * cdef size_t offset
9594  *
9595  */
9596  __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
9597  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9598 
9599  /* "View.MemoryView":305
9600  *
9601  * with cython.cdivision(True):
9602  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9603  *
9604  * if offset > 0:
9605  */
9606  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9607 
9608  /* "View.MemoryView":307
9609  * offset = aligned_p % alignment
9610  *
9611  * if offset > 0: # <<<<<<<<<<<<<<
9612  * aligned_p += alignment - offset
9613  *
9614  */
9615  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9616  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9617  if (__pyx_t_1) {
9618 
9619  /* "View.MemoryView":308
9620  *
9621  * if offset > 0:
9622  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
9623  *
9624  * return <void *> aligned_p
9625  */
9626  __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
9627  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9628 
9629  /* "View.MemoryView":307
9630  * offset = aligned_p % alignment
9631  *
9632  * if offset > 0: # <<<<<<<<<<<<<<
9633  * aligned_p += alignment - offset
9634  *
9635  */
9636  }
9637 
9638  /* "View.MemoryView":310
9639  * aligned_p += alignment - offset
9640  *
9641  * return <void *> aligned_p # <<<<<<<<<<<<<<
9642  *
9643  *
9644  */
9645  __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
9646  __pyx_r = ((void *)__pyx_v_aligned_p);
9647  goto __pyx_L0;
9648 
9649  /* "View.MemoryView":299
9650  *
9651  * @cname('__pyx_align_pointer')
9652  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9653  * "Align pointer memory on a given boundary"
9654  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9655  */
9656 
9657  /* function exit code */
9658  __pyx_L1_error:;
9659  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9660  __pyx_r = 0;
9661  __pyx_L0:;
9662  __Pyx_TraceReturn(Py_None, 1);
9663  return __pyx_r;
9664 }
9665 
9666 /* "View.MemoryView":346
9667  * cdef __Pyx_TypeInfo *typeinfo
9668  *
9669  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9670  * self.obj = obj
9671  * self.flags = flags
9672  */
9673 
9674 /* Python wrapper */
9675 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9676 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9677  PyObject *__pyx_v_obj = 0;
9678  int __pyx_v_flags;
9679  int __pyx_v_dtype_is_object;
9680  int __pyx_lineno = 0;
9681  const char *__pyx_filename = NULL;
9682  int __pyx_clineno = 0;
9683  int __pyx_r;
9684  __Pyx_RefNannyDeclarations
9685  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9686  {
9687  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9688  PyObject* values[3] = {0,0,0};
9689  if (unlikely(__pyx_kwds)) {
9690  Py_ssize_t kw_args;
9691  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9692  switch (pos_args) {
9693  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9694  CYTHON_FALLTHROUGH;
9695  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9696  CYTHON_FALLTHROUGH;
9697  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9698  CYTHON_FALLTHROUGH;
9699  case 0: break;
9700  default: goto __pyx_L5_argtuple_error;
9701  }
9702  kw_args = PyDict_Size(__pyx_kwds);
9703  switch (pos_args) {
9704  case 0:
9705  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9706  else goto __pyx_L5_argtuple_error;
9707  CYTHON_FALLTHROUGH;
9708  case 1:
9709  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9710  else {
9711  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
9712  }
9713  CYTHON_FALLTHROUGH;
9714  case 2:
9715  if (kw_args > 0) {
9716  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9717  if (value) { values[2] = value; kw_args--; }
9718  }
9719  }
9720  if (unlikely(kw_args > 0)) {
9721  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
9722  }
9723  } else {
9724  switch (PyTuple_GET_SIZE(__pyx_args)) {
9725  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9726  CYTHON_FALLTHROUGH;
9727  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9728  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9729  break;
9730  default: goto __pyx_L5_argtuple_error;
9731  }
9732  }
9733  __pyx_v_obj = values[0];
9734  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9735  if (values[2]) {
9736  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9737  } else {
9738  __pyx_v_dtype_is_object = ((int)0);
9739  }
9740  }
9741  goto __pyx_L4_argument_unpacking_done;
9742  __pyx_L5_argtuple_error:;
9743  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
9744  __pyx_L3_error:;
9745  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9746  __Pyx_RefNannyFinishContext();
9747  return -1;
9748  __pyx_L4_argument_unpacking_done:;
9749  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9750 
9751  /* function exit code */
9752  __Pyx_RefNannyFinishContext();
9753  return __pyx_r;
9754 }
9755 
9756 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
9757  int __pyx_r;
9758  __Pyx_TraceDeclarations
9759  __Pyx_RefNannyDeclarations
9760  int __pyx_t_1;
9761  int __pyx_t_2;
9762  int __pyx_t_3;
9763  int __pyx_t_4;
9764  int __pyx_lineno = 0;
9765  const char *__pyx_filename = NULL;
9766  int __pyx_clineno = 0;
9767  __Pyx_RefNannySetupContext("__cinit__", 0);
9768  __Pyx_TraceCall("__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
9769 
9770  /* "View.MemoryView":347
9771  *
9772  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9773  * self.obj = obj # <<<<<<<<<<<<<<
9774  * self.flags = flags
9775  * if type(self) is memoryview or obj is not None:
9776  */
9777  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9778  __Pyx_INCREF(__pyx_v_obj);
9779  __Pyx_GIVEREF(__pyx_v_obj);
9780  __Pyx_GOTREF(__pyx_v_self->obj);
9781  __Pyx_DECREF(__pyx_v_self->obj);
9782  __pyx_v_self->obj = __pyx_v_obj;
9783 
9784  /* "View.MemoryView":348
9785  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9786  * self.obj = obj
9787  * self.flags = flags # <<<<<<<<<<<<<<
9788  * if type(self) is memoryview or obj is not None:
9789  * __Pyx_GetBuffer(obj, &self.view, flags)
9790  */
9791  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9792  __pyx_v_self->flags = __pyx_v_flags;
9793 
9794  /* "View.MemoryView":349
9795  * self.obj = obj
9796  * self.flags = flags
9797  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9798  * __Pyx_GetBuffer(obj, &self.view, flags)
9799  * if <PyObject *> self.view.obj == NULL:
9800  */
9801  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9802  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9803  __pyx_t_3 = (__pyx_t_2 != 0);
9804  if (!__pyx_t_3) {
9805  } else {
9806  __pyx_t_1 = __pyx_t_3;
9807  goto __pyx_L4_bool_binop_done;
9808  }
9809  __pyx_t_3 = (__pyx_v_obj != Py_None);
9810  __pyx_t_2 = (__pyx_t_3 != 0);
9811  __pyx_t_1 = __pyx_t_2;
9812  __pyx_L4_bool_binop_done:;
9813  if (__pyx_t_1) {
9814 
9815  /* "View.MemoryView":350
9816  * self.flags = flags
9817  * if type(self) is memoryview or obj is not None:
9818  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9819  * if <PyObject *> self.view.obj == NULL:
9820  * (<__pyx_buffer *> &self.view).obj = Py_None
9821  */
9822  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9823  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9824 
9825  /* "View.MemoryView":351
9826  * if type(self) is memoryview or obj is not None:
9827  * __Pyx_GetBuffer(obj, &self.view, flags)
9828  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9829  * (<__pyx_buffer *> &self.view).obj = Py_None
9830  * Py_INCREF(Py_None)
9831  */
9832  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9833  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9834  if (__pyx_t_1) {
9835 
9836  /* "View.MemoryView":352
9837  * __Pyx_GetBuffer(obj, &self.view, flags)
9838  * if <PyObject *> self.view.obj == NULL:
9839  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9840  * Py_INCREF(Py_None)
9841  *
9842  */
9843  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9844  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9845 
9846  /* "View.MemoryView":353
9847  * if <PyObject *> self.view.obj == NULL:
9848  * (<__pyx_buffer *> &self.view).obj = Py_None
9849  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9850  *
9851  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9852  */
9853  __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9854  Py_INCREF(Py_None);
9855 
9856  /* "View.MemoryView":351
9857  * if type(self) is memoryview or obj is not None:
9858  * __Pyx_GetBuffer(obj, &self.view, flags)
9859  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9860  * (<__pyx_buffer *> &self.view).obj = Py_None
9861  * Py_INCREF(Py_None)
9862  */
9863  }
9864 
9865  /* "View.MemoryView":349
9866  * self.obj = obj
9867  * self.flags = flags
9868  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9869  * __Pyx_GetBuffer(obj, &self.view, flags)
9870  * if <PyObject *> self.view.obj == NULL:
9871  */
9872  }
9873 
9874  /* "View.MemoryView":355
9875  * Py_INCREF(Py_None)
9876  *
9877  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9878  * global __pyx_memoryview_thread_locks_used
9879  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9880  */
9881  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9882  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9883  if (__pyx_t_1) {
9884 
9885  /* "View.MemoryView":357
9886  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9887  * global __pyx_memoryview_thread_locks_used
9888  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9889  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9890  * __pyx_memoryview_thread_locks_used += 1
9891  */
9892  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9893  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9894  if (__pyx_t_1) {
9895 
9896  /* "View.MemoryView":358
9897  * global __pyx_memoryview_thread_locks_used
9898  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9899  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9900  * __pyx_memoryview_thread_locks_used += 1
9901  * if self.lock is NULL:
9902  */
9903  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9904  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9905 
9906  /* "View.MemoryView":359
9907  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9908  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9909  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9910  * if self.lock is NULL:
9911  * self.lock = PyThread_allocate_lock()
9912  */
9913  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9914  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9915 
9916  /* "View.MemoryView":357
9917  * if not __PYX_CYTHON_ATOMICS_ENABLED():
9918  * global __pyx_memoryview_thread_locks_used
9919  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9920  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9921  * __pyx_memoryview_thread_locks_used += 1
9922  */
9923  }
9924 
9925  /* "View.MemoryView":360
9926  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9927  * __pyx_memoryview_thread_locks_used += 1
9928  * if self.lock is NULL: # <<<<<<<<<<<<<<
9929  * self.lock = PyThread_allocate_lock()
9930  * if self.lock is NULL:
9931  */
9932  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9933  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9934  if (__pyx_t_1) {
9935 
9936  /* "View.MemoryView":361
9937  * __pyx_memoryview_thread_locks_used += 1
9938  * if self.lock is NULL:
9939  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9940  * if self.lock is NULL:
9941  * raise MemoryError
9942  */
9943  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9944  __pyx_v_self->lock = PyThread_allocate_lock();
9945 
9946  /* "View.MemoryView":362
9947  * if self.lock is NULL:
9948  * self.lock = PyThread_allocate_lock()
9949  * if self.lock is NULL: # <<<<<<<<<<<<<<
9950  * raise MemoryError
9951  *
9952  */
9953  __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9954  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9955  if (unlikely(__pyx_t_1)) {
9956 
9957  /* "View.MemoryView":363
9958  * self.lock = PyThread_allocate_lock()
9959  * if self.lock is NULL:
9960  * raise MemoryError # <<<<<<<<<<<<<<
9961  *
9962  * if flags & PyBUF_FORMAT:
9963  */
9964  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9965  PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
9966 
9967  /* "View.MemoryView":362
9968  * if self.lock is NULL:
9969  * self.lock = PyThread_allocate_lock()
9970  * if self.lock is NULL: # <<<<<<<<<<<<<<
9971  * raise MemoryError
9972  *
9973  */
9974  }
9975 
9976  /* "View.MemoryView":360
9977  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9978  * __pyx_memoryview_thread_locks_used += 1
9979  * if self.lock is NULL: # <<<<<<<<<<<<<<
9980  * self.lock = PyThread_allocate_lock()
9981  * if self.lock is NULL:
9982  */
9983  }
9984 
9985  /* "View.MemoryView":355
9986  * Py_INCREF(Py_None)
9987  *
9988  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9989  * global __pyx_memoryview_thread_locks_used
9990  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9991  */
9992  }
9993 
9994  /* "View.MemoryView":365
9995  * raise MemoryError
9996  *
9997  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9998  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9999  * else:
10000  */
10001  __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
10002  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10003  if (__pyx_t_1) {
10004 
10005  /* "View.MemoryView":366
10006  *
10007  * if flags & PyBUF_FORMAT:
10008  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10009  * else:
10010  * self.dtype_is_object = dtype_is_object
10011  */
10012  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
10013  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10014  if (__pyx_t_2) {
10015  } else {
10016  __pyx_t_1 = __pyx_t_2;
10017  goto __pyx_L12_bool_binop_done;
10018  }
10019  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10020  __pyx_t_1 = __pyx_t_2;
10021  __pyx_L12_bool_binop_done:;
10022  __pyx_v_self->dtype_is_object = __pyx_t_1;
10023 
10024  /* "View.MemoryView":365
10025  * raise MemoryError
10026  *
10027  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10028  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10029  * else:
10030  */
10031  goto __pyx_L11;
10032  }
10033 
10034  /* "View.MemoryView":368
10035  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10036  * else:
10037  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10038  *
10039  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10040  */
10041  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
10042  /*else*/ {
10043  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10044  }
10045  __pyx_L11:;
10046 
10047  /* "View.MemoryView":370
10048  * self.dtype_is_object = dtype_is_object
10049  *
10050  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10051  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10052  * self.typeinfo = NULL
10053  */
10054  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
10055  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10056 
10057  /* "View.MemoryView":372
10058  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10059  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10060  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10061  *
10062  * def __dealloc__(memoryview self):
10063  */
10064  __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
10065  __pyx_v_self->typeinfo = NULL;
10066 
10067  /* "View.MemoryView":346
10068  * cdef __Pyx_TypeInfo *typeinfo
10069  *
10070  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10071  * self.obj = obj
10072  * self.flags = flags
10073  */
10074 
10075  /* function exit code */
10076  __pyx_r = 0;
10077  goto __pyx_L0;
10078  __pyx_L1_error:;
10079  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10080  __pyx_r = -1;
10081  __pyx_L0:;
10082  __Pyx_TraceReturn(Py_None, 0);
10083  __Pyx_RefNannyFinishContext();
10084  return __pyx_r;
10085 }
10086 
10087 /* "View.MemoryView":374
10088  * self.typeinfo = NULL
10089  *
10090  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10091  * if self.obj is not None:
10092  * __Pyx_ReleaseBuffer(&self.view)
10093  */
10094 
10095 /* Python wrapper */
10096 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10097 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10098  __Pyx_RefNannyDeclarations
10099  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10100  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10101 
10102  /* function exit code */
10103  __Pyx_RefNannyFinishContext();
10104 }
10105 
10106 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10107  int __pyx_v_i;
10108  __Pyx_TraceDeclarations
10109  __Pyx_RefNannyDeclarations
10110  int __pyx_t_1;
10111  int __pyx_t_2;
10112  int __pyx_t_3;
10113  int __pyx_t_4;
10114  int __pyx_t_5;
10115  PyThread_type_lock __pyx_t_6;
10116  PyThread_type_lock __pyx_t_7;
10117  int __pyx_lineno = 0;
10118  const char *__pyx_filename = NULL;
10119  int __pyx_clineno = 0;
10120  __Pyx_RefNannySetupContext("__dealloc__", 0);
10121  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
10122 
10123  /* "View.MemoryView":375
10124  *
10125  * def __dealloc__(memoryview self):
10126  * if self.obj is not None: # <<<<<<<<<<<<<<
10127  * __Pyx_ReleaseBuffer(&self.view)
10128  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10129  */
10130  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
10131  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10132  __pyx_t_2 = (__pyx_t_1 != 0);
10133  if (__pyx_t_2) {
10134 
10135  /* "View.MemoryView":376
10136  * def __dealloc__(memoryview self):
10137  * if self.obj is not None:
10138  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10139  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10140  *
10141  */
10142  __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
10143  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10144 
10145  /* "View.MemoryView":375
10146  *
10147  * def __dealloc__(memoryview self):
10148  * if self.obj is not None: # <<<<<<<<<<<<<<
10149  * __Pyx_ReleaseBuffer(&self.view)
10150  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10151  */
10152  goto __pyx_L3;
10153  }
10154 
10155  /* "View.MemoryView":377
10156  * if self.obj is not None:
10157  * __Pyx_ReleaseBuffer(&self.view)
10158  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10159  *
10160  * (<__pyx_buffer *> &self.view).obj = NULL
10161  */
10162  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
10163  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10164  if (__pyx_t_2) {
10165 
10166  /* "View.MemoryView":379
10167  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10168  *
10169  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10170  * Py_DECREF(Py_None)
10171  *
10172  */
10173  __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
10174  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10175 
10176  /* "View.MemoryView":380
10177  *
10178  * (<__pyx_buffer *> &self.view).obj = NULL
10179  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10180  *
10181  * cdef int i
10182  */
10183  __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
10184  Py_DECREF(Py_None);
10185 
10186  /* "View.MemoryView":377
10187  * if self.obj is not None:
10188  * __Pyx_ReleaseBuffer(&self.view)
10189  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10190  *
10191  * (<__pyx_buffer *> &self.view).obj = NULL
10192  */
10193  }
10194  __pyx_L3:;
10195 
10196  /* "View.MemoryView":384
10197  * cdef int i
10198  * global __pyx_memoryview_thread_locks_used
10199  * if self.lock != NULL: # <<<<<<<<<<<<<<
10200  * for i in range(__pyx_memoryview_thread_locks_used):
10201  * if __pyx_memoryview_thread_locks[i] is self.lock:
10202  */
10203  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
10204  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10205  if (__pyx_t_2) {
10206 
10207  /* "View.MemoryView":385
10208  * global __pyx_memoryview_thread_locks_used
10209  * if self.lock != NULL:
10210  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10211  * if __pyx_memoryview_thread_locks[i] is self.lock:
10212  * __pyx_memoryview_thread_locks_used -= 1
10213  */
10214  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
10215  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10216  __pyx_t_4 = __pyx_t_3;
10217  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10218  __pyx_v_i = __pyx_t_5;
10219 
10220  /* "View.MemoryView":386
10221  * if self.lock != NULL:
10222  * for i in range(__pyx_memoryview_thread_locks_used):
10223  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10224  * __pyx_memoryview_thread_locks_used -= 1
10225  * if i != __pyx_memoryview_thread_locks_used:
10226  */
10227  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
10228  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10229  if (__pyx_t_2) {
10230 
10231  /* "View.MemoryView":387
10232  * for i in range(__pyx_memoryview_thread_locks_used):
10233  * if __pyx_memoryview_thread_locks[i] is self.lock:
10234  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10235  * if i != __pyx_memoryview_thread_locks_used:
10236  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10237  */
10238  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
10239  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10240 
10241  /* "View.MemoryView":388
10242  * if __pyx_memoryview_thread_locks[i] is self.lock:
10243  * __pyx_memoryview_thread_locks_used -= 1
10244  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10245  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10246  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10247  */
10248  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
10249  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10250  if (__pyx_t_2) {
10251 
10252  /* "View.MemoryView":390
10253  * if i != __pyx_memoryview_thread_locks_used:
10254  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10255  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10256  * break
10257  * else:
10258  */
10259  __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
10260  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10261  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10262 
10263  /* "View.MemoryView":389
10264  * __pyx_memoryview_thread_locks_used -= 1
10265  * if i != __pyx_memoryview_thread_locks_used:
10266  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10267  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10268  * break
10269  */
10270  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
10271  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10272  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10273 
10274  /* "View.MemoryView":388
10275  * if __pyx_memoryview_thread_locks[i] is self.lock:
10276  * __pyx_memoryview_thread_locks_used -= 1
10277  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10278  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10279  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10280  */
10281  }
10282 
10283  /* "View.MemoryView":391
10284  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10285  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10286  * break # <<<<<<<<<<<<<<
10287  * else:
10288  * PyThread_free_lock(self.lock)
10289  */
10290  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
10291  goto __pyx_L6_break;
10292 
10293  /* "View.MemoryView":386
10294  * if self.lock != NULL:
10295  * for i in range(__pyx_memoryview_thread_locks_used):
10296  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10297  * __pyx_memoryview_thread_locks_used -= 1
10298  * if i != __pyx_memoryview_thread_locks_used:
10299  */
10300  }
10301  }
10302  /*else*/ {
10303 
10304  /* "View.MemoryView":393
10305  * break
10306  * else:
10307  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10308  *
10309  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10310  */
10311  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
10312  PyThread_free_lock(__pyx_v_self->lock);
10313  }
10314  __pyx_L6_break:;
10315 
10316  /* "View.MemoryView":384
10317  * cdef int i
10318  * global __pyx_memoryview_thread_locks_used
10319  * if self.lock != NULL: # <<<<<<<<<<<<<<
10320  * for i in range(__pyx_memoryview_thread_locks_used):
10321  * if __pyx_memoryview_thread_locks[i] is self.lock:
10322  */
10323  }
10324 
10325  /* "View.MemoryView":374
10326  * self.typeinfo = NULL
10327  *
10328  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10329  * if self.obj is not None:
10330  * __Pyx_ReleaseBuffer(&self.view)
10331  */
10332 
10333  /* function exit code */
10334  goto __pyx_L0;
10335  __pyx_L1_error:;
10336  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10337  __pyx_L0:;
10338  __Pyx_TraceReturn(Py_None, 0);
10339  __Pyx_RefNannyFinishContext();
10340 }
10341 
10342 /* "View.MemoryView":395
10343  * PyThread_free_lock(self.lock)
10344  *
10345  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10346  * cdef Py_ssize_t dim
10347  * cdef char *itemp = <char *> self.view.buf
10348  */
10349 
10350 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10351  Py_ssize_t __pyx_v_dim;
10352  char *__pyx_v_itemp;
10353  PyObject *__pyx_v_idx = NULL;
10354  char *__pyx_r;
10355  __Pyx_TraceDeclarations
10356  __Pyx_RefNannyDeclarations
10357  Py_ssize_t __pyx_t_1;
10358  PyObject *__pyx_t_2 = NULL;
10359  Py_ssize_t __pyx_t_3;
10360  PyObject *(*__pyx_t_4)(PyObject *);
10361  PyObject *__pyx_t_5 = NULL;
10362  Py_ssize_t __pyx_t_6;
10363  char *__pyx_t_7;
10364  int __pyx_lineno = 0;
10365  const char *__pyx_filename = NULL;
10366  int __pyx_clineno = 0;
10367  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10368  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
10369 
10370  /* "View.MemoryView":397
10371  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10372  * cdef Py_ssize_t dim
10373  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10374  *
10375  * for dim, idx in enumerate(index):
10376  */
10377  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10378  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10379 
10380  /* "View.MemoryView":399
10381  * cdef char *itemp = <char *> self.view.buf
10382  *
10383  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10384  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10385  *
10386  */
10387  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10388  __pyx_t_1 = 0;
10389  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10390  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10391  __pyx_t_4 = NULL;
10392  } else {
10393  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
10394  __Pyx_GOTREF(__pyx_t_2);
10395  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
10396  }
10397  for (;;) {
10398  if (likely(!__pyx_t_4)) {
10399  if (likely(PyList_CheckExact(__pyx_t_2))) {
10400  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10401  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10402  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10403  #else
10404  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10405  __Pyx_GOTREF(__pyx_t_5);
10406  #endif
10407  } else {
10408  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10409  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10410  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10411  #else
10412  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10413  __Pyx_GOTREF(__pyx_t_5);
10414  #endif
10415  }
10416  } else {
10417  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10418  if (unlikely(!__pyx_t_5)) {
10419  PyObject* exc_type = PyErr_Occurred();
10420  if (exc_type) {
10421  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10422  else __PYX_ERR(1, 399, __pyx_L1_error)
10423  }
10424  break;
10425  }
10426  __Pyx_GOTREF(__pyx_t_5);
10427  }
10428  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10429  __pyx_t_5 = 0;
10430  __pyx_v_dim = __pyx_t_1;
10431  __pyx_t_1 = (__pyx_t_1 + 1);
10432 
10433  /* "View.MemoryView":400
10434  *
10435  * for dim, idx in enumerate(index):
10436  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10437  *
10438  * return itemp
10439  */
10440  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10441  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
10442  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
10443  __pyx_v_itemp = __pyx_t_7;
10444 
10445  /* "View.MemoryView":399
10446  * cdef char *itemp = <char *> self.view.buf
10447  *
10448  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10449  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10450  *
10451  */
10452  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10453  }
10454  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10455 
10456  /* "View.MemoryView":402
10457  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10458  *
10459  * return itemp # <<<<<<<<<<<<<<
10460  *
10461  *
10462  */
10463  __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
10464  __pyx_r = __pyx_v_itemp;
10465  goto __pyx_L0;
10466 
10467  /* "View.MemoryView":395
10468  * PyThread_free_lock(self.lock)
10469  *
10470  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10471  * cdef Py_ssize_t dim
10472  * cdef char *itemp = <char *> self.view.buf
10473  */
10474 
10475  /* function exit code */
10476  __pyx_L1_error:;
10477  __Pyx_XDECREF(__pyx_t_2);
10478  __Pyx_XDECREF(__pyx_t_5);
10479  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10480  __pyx_r = NULL;
10481  __pyx_L0:;
10482  __Pyx_XDECREF(__pyx_v_idx);
10483  __Pyx_TraceReturn(Py_None, 0);
10484  __Pyx_RefNannyFinishContext();
10485  return __pyx_r;
10486 }
10487 
10488 /* "View.MemoryView":405
10489  *
10490  *
10491  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10492  * if index is Ellipsis:
10493  * return self
10494  */
10495 
10496 /* Python wrapper */
10497 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10498 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10499  PyObject *__pyx_r = 0;
10500  __Pyx_RefNannyDeclarations
10501  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10502  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10503 
10504  /* function exit code */
10505  __Pyx_RefNannyFinishContext();
10506  return __pyx_r;
10507 }
10508 
10509 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10510  PyObject *__pyx_v_have_slices = NULL;
10511  PyObject *__pyx_v_indices = NULL;
10512  char *__pyx_v_itemp;
10513  PyObject *__pyx_r = NULL;
10514  __Pyx_TraceDeclarations
10515  __Pyx_RefNannyDeclarations
10516  int __pyx_t_1;
10517  int __pyx_t_2;
10518  PyObject *__pyx_t_3 = NULL;
10519  PyObject *__pyx_t_4 = NULL;
10520  PyObject *__pyx_t_5 = NULL;
10521  char *__pyx_t_6;
10522  int __pyx_lineno = 0;
10523  const char *__pyx_filename = NULL;
10524  int __pyx_clineno = 0;
10525  __Pyx_RefNannySetupContext("__getitem__", 0);
10526  __Pyx_TraceCall("__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
10527 
10528  /* "View.MemoryView":406
10529  *
10530  * def __getitem__(memoryview self, object index):
10531  * if index is Ellipsis: # <<<<<<<<<<<<<<
10532  * return self
10533  *
10534  */
10535  __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
10536  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10537  __pyx_t_2 = (__pyx_t_1 != 0);
10538  if (__pyx_t_2) {
10539 
10540  /* "View.MemoryView":407
10541  * def __getitem__(memoryview self, object index):
10542  * if index is Ellipsis:
10543  * return self # <<<<<<<<<<<<<<
10544  *
10545  * have_slices, indices = _unellipsify(index, self.view.ndim)
10546  */
10547  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10548  __Pyx_XDECREF(__pyx_r);
10549  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10550  __pyx_r = ((PyObject *)__pyx_v_self);
10551  goto __pyx_L0;
10552 
10553  /* "View.MemoryView":406
10554  *
10555  * def __getitem__(memoryview self, object index):
10556  * if index is Ellipsis: # <<<<<<<<<<<<<<
10557  * return self
10558  *
10559  */
10560  }
10561 
10562  /* "View.MemoryView":409
10563  * return self
10564  *
10565  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10566  *
10567  * cdef char *itemp
10568  */
10569  __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
10570  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
10571  __Pyx_GOTREF(__pyx_t_3);
10572  if (likely(__pyx_t_3 != Py_None)) {
10573  PyObject* sequence = __pyx_t_3;
10574  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10575  if (unlikely(size != 2)) {
10576  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10577  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10578  __PYX_ERR(1, 409, __pyx_L1_error)
10579  }
10580  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10581  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10582  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10583  __Pyx_INCREF(__pyx_t_4);
10584  __Pyx_INCREF(__pyx_t_5);
10585  #else
10586  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
10587  __Pyx_GOTREF(__pyx_t_4);
10588  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
10589  __Pyx_GOTREF(__pyx_t_5);
10590  #endif
10591  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10592  } else {
10593  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
10594  }
10595  __pyx_v_have_slices = __pyx_t_4;
10596  __pyx_t_4 = 0;
10597  __pyx_v_indices = __pyx_t_5;
10598  __pyx_t_5 = 0;
10599 
10600  /* "View.MemoryView":412
10601  *
10602  * cdef char *itemp
10603  * if have_slices: # <<<<<<<<<<<<<<
10604  * return memview_slice(self, indices)
10605  * else:
10606  */
10607  __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
10608  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
10609  if (__pyx_t_2) {
10610 
10611  /* "View.MemoryView":413
10612  * cdef char *itemp
10613  * if have_slices:
10614  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10615  * else:
10616  * itemp = self.get_item_pointer(indices)
10617  */
10618  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10619  __Pyx_XDECREF(__pyx_r);
10620  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
10621  __Pyx_GOTREF(__pyx_t_3);
10622  __pyx_r = __pyx_t_3;
10623  __pyx_t_3 = 0;
10624  goto __pyx_L0;
10625 
10626  /* "View.MemoryView":412
10627  *
10628  * cdef char *itemp
10629  * if have_slices: # <<<<<<<<<<<<<<
10630  * return memview_slice(self, indices)
10631  * else:
10632  */
10633  }
10634 
10635  /* "View.MemoryView":415
10636  * return memview_slice(self, indices)
10637  * else:
10638  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10639  * return self.convert_item_to_object(itemp)
10640  *
10641  */
10642  __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
10643  /*else*/ {
10644  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
10645  __pyx_v_itemp = __pyx_t_6;
10646 
10647  /* "View.MemoryView":416
10648  * else:
10649  * itemp = self.get_item_pointer(indices)
10650  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10651  *
10652  * def __setitem__(memoryview self, object index, object value):
10653  */
10654  __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
10655  __Pyx_XDECREF(__pyx_r);
10656  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
10657  __Pyx_GOTREF(__pyx_t_3);
10658  __pyx_r = __pyx_t_3;
10659  __pyx_t_3 = 0;
10660  goto __pyx_L0;
10661  }
10662 
10663  /* "View.MemoryView":405
10664  *
10665  *
10666  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10667  * if index is Ellipsis:
10668  * return self
10669  */
10670 
10671  /* function exit code */
10672  __pyx_L1_error:;
10673  __Pyx_XDECREF(__pyx_t_3);
10674  __Pyx_XDECREF(__pyx_t_4);
10675  __Pyx_XDECREF(__pyx_t_5);
10676  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10677  __pyx_r = NULL;
10678  __pyx_L0:;
10679  __Pyx_XDECREF(__pyx_v_have_slices);
10680  __Pyx_XDECREF(__pyx_v_indices);
10681  __Pyx_XGIVEREF(__pyx_r);
10682  __Pyx_TraceReturn(__pyx_r, 0);
10683  __Pyx_RefNannyFinishContext();
10684  return __pyx_r;
10685 }
10686 
10687 /* "View.MemoryView":418
10688  * return self.convert_item_to_object(itemp)
10689  *
10690  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10691  * if self.view.readonly:
10692  * raise TypeError("Cannot assign to read-only memoryview")
10693  */
10694 
10695 /* Python wrapper */
10696 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10697 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10698  int __pyx_r;
10699  __Pyx_RefNannyDeclarations
10700  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10701  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10702 
10703  /* function exit code */
10704  __Pyx_RefNannyFinishContext();
10705  return __pyx_r;
10706 }
10707 
10708 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10709  PyObject *__pyx_v_have_slices = NULL;
10710  PyObject *__pyx_v_obj = NULL;
10711  int __pyx_r;
10712  __Pyx_TraceDeclarations
10713  __Pyx_RefNannyDeclarations
10714  int __pyx_t_1;
10715  PyObject *__pyx_t_2 = NULL;
10716  PyObject *__pyx_t_3 = NULL;
10717  PyObject *__pyx_t_4 = NULL;
10718  int __pyx_lineno = 0;
10719  const char *__pyx_filename = NULL;
10720  int __pyx_clineno = 0;
10721  __Pyx_RefNannySetupContext("__setitem__", 0);
10722  __Pyx_TraceCall("__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
10723  __Pyx_INCREF(__pyx_v_index);
10724 
10725  /* "View.MemoryView":419
10726  *
10727  * def __setitem__(memoryview self, object index, object value):
10728  * if self.view.readonly: # <<<<<<<<<<<<<<
10729  * raise TypeError("Cannot assign to read-only memoryview")
10730  *
10731  */
10732  __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
10733  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10734  if (unlikely(__pyx_t_1)) {
10735 
10736  /* "View.MemoryView":420
10737  * def __setitem__(memoryview self, object index, object value):
10738  * if self.view.readonly:
10739  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
10740  *
10741  * have_slices, index = _unellipsify(index, self.view.ndim)
10742  */
10743  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10744  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10745  __Pyx_GOTREF(__pyx_t_2);
10746  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10747  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10748  __PYX_ERR(1, 420, __pyx_L1_error)
10749 
10750  /* "View.MemoryView":419
10751  *
10752  * def __setitem__(memoryview self, object index, object value):
10753  * if self.view.readonly: # <<<<<<<<<<<<<<
10754  * raise TypeError("Cannot assign to read-only memoryview")
10755  *
10756  */
10757  }
10758 
10759  /* "View.MemoryView":422
10760  * raise TypeError("Cannot assign to read-only memoryview")
10761  *
10762  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10763  *
10764  * if have_slices:
10765  */
10766  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10767  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
10768  __Pyx_GOTREF(__pyx_t_2);
10769  if (likely(__pyx_t_2 != Py_None)) {
10770  PyObject* sequence = __pyx_t_2;
10771  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10772  if (unlikely(size != 2)) {
10773  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10774  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10775  __PYX_ERR(1, 422, __pyx_L1_error)
10776  }
10777  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10778  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10779  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10780  __Pyx_INCREF(__pyx_t_3);
10781  __Pyx_INCREF(__pyx_t_4);
10782  #else
10783  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10784  __Pyx_GOTREF(__pyx_t_3);
10785  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10786  __Pyx_GOTREF(__pyx_t_4);
10787  #endif
10788  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10789  } else {
10790  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10791  }
10792  __pyx_v_have_slices = __pyx_t_3;
10793  __pyx_t_3 = 0;
10794  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10795  __pyx_t_4 = 0;
10796 
10797  /* "View.MemoryView":424
10798  * have_slices, index = _unellipsify(index, self.view.ndim)
10799  *
10800  * if have_slices: # <<<<<<<<<<<<<<
10801  * obj = self.is_slice(value)
10802  * if obj:
10803  */
10804  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10805  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10806  if (__pyx_t_1) {
10807 
10808  /* "View.MemoryView":425
10809  *
10810  * if have_slices:
10811  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10812  * if obj:
10813  * self.setitem_slice_assignment(self[index], obj)
10814  */
10815  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10816  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10817  __Pyx_GOTREF(__pyx_t_2);
10818  __pyx_v_obj = __pyx_t_2;
10819  __pyx_t_2 = 0;
10820 
10821  /* "View.MemoryView":426
10822  * if have_slices:
10823  * obj = self.is_slice(value)
10824  * if obj: # <<<<<<<<<<<<<<
10825  * self.setitem_slice_assignment(self[index], obj)
10826  * else:
10827  */
10828  __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10829  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10830  if (__pyx_t_1) {
10831 
10832  /* "View.MemoryView":427
10833  * obj = self.is_slice(value)
10834  * if obj:
10835  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10836  * else:
10837  * self.setitem_slice_assign_scalar(self[index], value)
10838  */
10839  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10840  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10841  __Pyx_GOTREF(__pyx_t_2);
10842  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10843  __Pyx_GOTREF(__pyx_t_4);
10844  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10845  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10846 
10847  /* "View.MemoryView":426
10848  * if have_slices:
10849  * obj = self.is_slice(value)
10850  * if obj: # <<<<<<<<<<<<<<
10851  * self.setitem_slice_assignment(self[index], obj)
10852  * else:
10853  */
10854  goto __pyx_L5;
10855  }
10856 
10857  /* "View.MemoryView":429
10858  * self.setitem_slice_assignment(self[index], obj)
10859  * else:
10860  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10861  * else:
10862  * self.setitem_indexed(index, value)
10863  */
10864  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10865  /*else*/ {
10866  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10867  __Pyx_GOTREF(__pyx_t_4);
10868  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10869  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10870  __Pyx_GOTREF(__pyx_t_2);
10871  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10873  }
10874  __pyx_L5:;
10875 
10876  /* "View.MemoryView":424
10877  * have_slices, index = _unellipsify(index, self.view.ndim)
10878  *
10879  * if have_slices: # <<<<<<<<<<<<<<
10880  * obj = self.is_slice(value)
10881  * if obj:
10882  */
10883  goto __pyx_L4;
10884  }
10885 
10886  /* "View.MemoryView":431
10887  * self.setitem_slice_assign_scalar(self[index], value)
10888  * else:
10889  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10890  *
10891  * cdef is_slice(self, obj):
10892  */
10893  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10894  /*else*/ {
10895  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10896  __Pyx_GOTREF(__pyx_t_2);
10897  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10898  }
10899  __pyx_L4:;
10900 
10901  /* "View.MemoryView":418
10902  * return self.convert_item_to_object(itemp)
10903  *
10904  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10905  * if self.view.readonly:
10906  * raise TypeError("Cannot assign to read-only memoryview")
10907  */
10908 
10909  /* function exit code */
10910  __pyx_r = 0;
10911  goto __pyx_L0;
10912  __pyx_L1_error:;
10913  __Pyx_XDECREF(__pyx_t_2);
10914  __Pyx_XDECREF(__pyx_t_3);
10915  __Pyx_XDECREF(__pyx_t_4);
10916  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10917  __pyx_r = -1;
10918  __pyx_L0:;
10919  __Pyx_XDECREF(__pyx_v_have_slices);
10920  __Pyx_XDECREF(__pyx_v_obj);
10921  __Pyx_XDECREF(__pyx_v_index);
10922  __Pyx_TraceReturn(Py_None, 0);
10923  __Pyx_RefNannyFinishContext();
10924  return __pyx_r;
10925 }
10926 
10927 /* "View.MemoryView":433
10928  * self.setitem_indexed(index, value)
10929  *
10930  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10931  * if not isinstance(obj, memoryview):
10932  * try:
10933  */
10934 
10935 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10936  PyObject *__pyx_r = NULL;
10937  __Pyx_TraceDeclarations
10938  __Pyx_RefNannyDeclarations
10939  int __pyx_t_1;
10940  int __pyx_t_2;
10941  PyObject *__pyx_t_3 = NULL;
10942  PyObject *__pyx_t_4 = NULL;
10943  PyObject *__pyx_t_5 = NULL;
10944  PyObject *__pyx_t_6 = NULL;
10945  PyObject *__pyx_t_7 = NULL;
10946  PyObject *__pyx_t_8 = NULL;
10947  int __pyx_t_9;
10948  int __pyx_lineno = 0;
10949  const char *__pyx_filename = NULL;
10950  int __pyx_clineno = 0;
10951  __Pyx_RefNannySetupContext("is_slice", 0);
10952  __Pyx_TraceCall("is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10953  __Pyx_INCREF(__pyx_v_obj);
10954 
10955  /* "View.MemoryView":434
10956  *
10957  * cdef is_slice(self, obj):
10958  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10959  * try:
10960  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10961  */
10962  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10963  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10964  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10965  if (__pyx_t_2) {
10966 
10967  /* "View.MemoryView":435
10968  * cdef is_slice(self, obj):
10969  * if not isinstance(obj, memoryview):
10970  * try: # <<<<<<<<<<<<<<
10971  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10972  * self.dtype_is_object)
10973  */
10974  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10975  {
10976  __Pyx_PyThreadState_declare
10977  __Pyx_PyThreadState_assign
10978  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10979  __Pyx_XGOTREF(__pyx_t_3);
10980  __Pyx_XGOTREF(__pyx_t_4);
10981  __Pyx_XGOTREF(__pyx_t_5);
10982  /*try:*/ {
10983 
10984  /* "View.MemoryView":436
10985  * if not isinstance(obj, memoryview):
10986  * try:
10987  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10988  * self.dtype_is_object)
10989  * except TypeError:
10990  */
10991  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10992  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10993  __Pyx_GOTREF(__pyx_t_6);
10994 
10995  /* "View.MemoryView":437
10996  * try:
10997  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10998  * self.dtype_is_object) # <<<<<<<<<<<<<<
10999  * except TypeError:
11000  * return None
11001  */
11002  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
11003  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
11004  __Pyx_GOTREF(__pyx_t_7);
11005 
11006  /* "View.MemoryView":436
11007  * if not isinstance(obj, memoryview):
11008  * try:
11009  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11010  * self.dtype_is_object)
11011  * except TypeError:
11012  */
11013  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
11014  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
11015  __Pyx_GOTREF(__pyx_t_8);
11016  __Pyx_INCREF(__pyx_v_obj);
11017  __Pyx_GIVEREF(__pyx_v_obj);
11018  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11019  __Pyx_GIVEREF(__pyx_t_6);
11020  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11021  __Pyx_GIVEREF(__pyx_t_7);
11022  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11023  __pyx_t_6 = 0;
11024  __pyx_t_7 = 0;
11025  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
11026  __Pyx_GOTREF(__pyx_t_7);
11027  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11028  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11029  __pyx_t_7 = 0;
11030 
11031  /* "View.MemoryView":435
11032  * cdef is_slice(self, obj):
11033  * if not isinstance(obj, memoryview):
11034  * try: # <<<<<<<<<<<<<<
11035  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11036  * self.dtype_is_object)
11037  */
11038  }
11039  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11040  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11041  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11042  goto __pyx_L9_try_end;
11043  __pyx_L4_error:;
11044  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11045  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11046  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11047 
11048  /* "View.MemoryView":438
11049  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11050  * self.dtype_is_object)
11051  * except TypeError: # <<<<<<<<<<<<<<
11052  * return None
11053  *
11054  */
11055  __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
11056  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11057  if (__pyx_t_9) {
11058  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11059  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
11060  __Pyx_GOTREF(__pyx_t_7);
11061  __Pyx_GOTREF(__pyx_t_8);
11062  __Pyx_GOTREF(__pyx_t_6);
11063 
11064  /* "View.MemoryView":439
11065  * self.dtype_is_object)
11066  * except TypeError:
11067  * return None # <<<<<<<<<<<<<<
11068  *
11069  * return obj
11070  */
11071  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
11072  __Pyx_XDECREF(__pyx_r);
11073  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11074  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11075  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11076  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11077  goto __pyx_L7_except_return;
11078  }
11079  goto __pyx_L6_except_error;
11080  __pyx_L6_except_error:;
11081 
11082  /* "View.MemoryView":435
11083  * cdef is_slice(self, obj):
11084  * if not isinstance(obj, memoryview):
11085  * try: # <<<<<<<<<<<<<<
11086  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11087  * self.dtype_is_object)
11088  */
11089  __Pyx_XGIVEREF(__pyx_t_3);
11090  __Pyx_XGIVEREF(__pyx_t_4);
11091  __Pyx_XGIVEREF(__pyx_t_5);
11092  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11093  goto __pyx_L1_error;
11094  __pyx_L7_except_return:;
11095  __Pyx_XGIVEREF(__pyx_t_3);
11096  __Pyx_XGIVEREF(__pyx_t_4);
11097  __Pyx_XGIVEREF(__pyx_t_5);
11098  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11099  goto __pyx_L0;
11100  __pyx_L9_try_end:;
11101  }
11102 
11103  /* "View.MemoryView":434
11104  *
11105  * cdef is_slice(self, obj):
11106  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11107  * try:
11108  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11109  */
11110  }
11111 
11112  /* "View.MemoryView":441
11113  * return None
11114  *
11115  * return obj # <<<<<<<<<<<<<<
11116  *
11117  * cdef setitem_slice_assignment(self, dst, src):
11118  */
11119  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
11120  __Pyx_XDECREF(__pyx_r);
11121  __Pyx_INCREF(__pyx_v_obj);
11122  __pyx_r = __pyx_v_obj;
11123  goto __pyx_L0;
11124 
11125  /* "View.MemoryView":433
11126  * self.setitem_indexed(index, value)
11127  *
11128  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11129  * if not isinstance(obj, memoryview):
11130  * try:
11131  */
11132 
11133  /* function exit code */
11134  __pyx_L1_error:;
11135  __Pyx_XDECREF(__pyx_t_6);
11136  __Pyx_XDECREF(__pyx_t_7);
11137  __Pyx_XDECREF(__pyx_t_8);
11138  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11139  __pyx_r = 0;
11140  __pyx_L0:;
11141  __Pyx_XDECREF(__pyx_v_obj);
11142  __Pyx_XGIVEREF(__pyx_r);
11143  __Pyx_TraceReturn(__pyx_r, 0);
11144  __Pyx_RefNannyFinishContext();
11145  return __pyx_r;
11146 }
11147 
11148 /* "View.MemoryView":443
11149  * return obj
11150  *
11151  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11152  * cdef __Pyx_memviewslice dst_slice
11153  * cdef __Pyx_memviewslice src_slice
11154  */
11155 
11156 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11157  __Pyx_memviewslice __pyx_v_dst_slice;
11158  __Pyx_memviewslice __pyx_v_src_slice;
11159  PyObject *__pyx_r = NULL;
11160  __Pyx_TraceDeclarations
11161  __Pyx_RefNannyDeclarations
11162  __Pyx_memviewslice *__pyx_t_1;
11163  __Pyx_memviewslice *__pyx_t_2;
11164  PyObject *__pyx_t_3 = NULL;
11165  int __pyx_t_4;
11166  int __pyx_t_5;
11167  int __pyx_t_6;
11168  int __pyx_lineno = 0;
11169  const char *__pyx_filename = NULL;
11170  int __pyx_clineno = 0;
11171  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11172  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
11173 
11174  /* "View.MemoryView":447
11175  * cdef __Pyx_memviewslice src_slice
11176  *
11177  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11178  * get_slice_from_memview(dst, &dst_slice)[0],
11179  * src.ndim, dst.ndim, self.dtype_is_object)
11180  */
11181  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11182  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
11183  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
11184 
11185  /* "View.MemoryView":448
11186  *
11187  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11188  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11189  * src.ndim, dst.ndim, self.dtype_is_object)
11190  *
11191  */
11192  __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
11193  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
11194  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
11195 
11196  /* "View.MemoryView":449
11197  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11198  * get_slice_from_memview(dst, &dst_slice)[0],
11199  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11200  *
11201  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11202  */
11203  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
11204  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11205  __Pyx_GOTREF(__pyx_t_3);
11206  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11207  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11208  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11209  __Pyx_GOTREF(__pyx_t_3);
11210  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11212 
11213  /* "View.MemoryView":447
11214  * cdef __Pyx_memviewslice src_slice
11215  *
11216  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11217  * get_slice_from_memview(dst, &dst_slice)[0],
11218  * src.ndim, dst.ndim, self.dtype_is_object)
11219  */
11220  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11221  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
11222 
11223  /* "View.MemoryView":443
11224  * return obj
11225  *
11226  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11227  * cdef __Pyx_memviewslice dst_slice
11228  * cdef __Pyx_memviewslice src_slice
11229  */
11230 
11231  /* function exit code */
11232  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11233  goto __pyx_L0;
11234  __pyx_L1_error:;
11235  __Pyx_XDECREF(__pyx_t_3);
11236  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11237  __pyx_r = 0;
11238  __pyx_L0:;
11239  __Pyx_XGIVEREF(__pyx_r);
11240  __Pyx_TraceReturn(__pyx_r, 0);
11241  __Pyx_RefNannyFinishContext();
11242  return __pyx_r;
11243 }
11244 
11245 /* "View.MemoryView":451
11246  * src.ndim, dst.ndim, self.dtype_is_object)
11247  *
11248  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11249  * cdef int array[128]
11250  * cdef void *tmp = NULL
11251  */
11252 
11253 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11254  int __pyx_v_array[0x80];
11255  void *__pyx_v_tmp;
11256  void *__pyx_v_item;
11257  __Pyx_memviewslice *__pyx_v_dst_slice;
11258  __Pyx_memviewslice __pyx_v_tmp_slice;
11259  PyObject *__pyx_r = NULL;
11260  __Pyx_TraceDeclarations
11261  __Pyx_RefNannyDeclarations
11262  __Pyx_memviewslice *__pyx_t_1;
11263  int __pyx_t_2;
11264  PyObject *__pyx_t_3 = NULL;
11265  int __pyx_t_4;
11266  int __pyx_t_5;
11267  char const *__pyx_t_6;
11268  PyObject *__pyx_t_7 = NULL;
11269  PyObject *__pyx_t_8 = NULL;
11270  PyObject *__pyx_t_9 = NULL;
11271  PyObject *__pyx_t_10 = NULL;
11272  PyObject *__pyx_t_11 = NULL;
11273  PyObject *__pyx_t_12 = NULL;
11274  int __pyx_lineno = 0;
11275  const char *__pyx_filename = NULL;
11276  int __pyx_clineno = 0;
11277  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11278  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
11279 
11280  /* "View.MemoryView":453
11281  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11282  * cdef int array[128]
11283  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11284  * cdef void *item
11285  *
11286  */
11287  __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
11288  __pyx_v_tmp = NULL;
11289 
11290  /* "View.MemoryView":458
11291  * cdef __Pyx_memviewslice *dst_slice
11292  * cdef __Pyx_memviewslice tmp_slice
11293  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11294  *
11295  * if <size_t>self.view.itemsize > sizeof(array):
11296  */
11297  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
11298  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
11299  __pyx_v_dst_slice = __pyx_t_1;
11300 
11301  /* "View.MemoryView":460
11302  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11303  *
11304  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11305  * tmp = PyMem_Malloc(self.view.itemsize)
11306  * if tmp == NULL:
11307  */
11308  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11309  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11310  if (__pyx_t_2) {
11311 
11312  /* "View.MemoryView":461
11313  *
11314  * if <size_t>self.view.itemsize > sizeof(array):
11315  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11316  * if tmp == NULL:
11317  * raise MemoryError
11318  */
11319  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11320  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11321 
11322  /* "View.MemoryView":462
11323  * if <size_t>self.view.itemsize > sizeof(array):
11324  * tmp = PyMem_Malloc(self.view.itemsize)
11325  * if tmp == NULL: # <<<<<<<<<<<<<<
11326  * raise MemoryError
11327  * item = tmp
11328  */
11329  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11330  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11331  if (unlikely(__pyx_t_2)) {
11332 
11333  /* "View.MemoryView":463
11334  * tmp = PyMem_Malloc(self.view.itemsize)
11335  * if tmp == NULL:
11336  * raise MemoryError # <<<<<<<<<<<<<<
11337  * item = tmp
11338  * else:
11339  */
11340  __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
11341  PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
11342 
11343  /* "View.MemoryView":462
11344  * if <size_t>self.view.itemsize > sizeof(array):
11345  * tmp = PyMem_Malloc(self.view.itemsize)
11346  * if tmp == NULL: # <<<<<<<<<<<<<<
11347  * raise MemoryError
11348  * item = tmp
11349  */
11350  }
11351 
11352  /* "View.MemoryView":464
11353  * if tmp == NULL:
11354  * raise MemoryError
11355  * item = tmp # <<<<<<<<<<<<<<
11356  * else:
11357  * item = <void *> array
11358  */
11359  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11360  __pyx_v_item = __pyx_v_tmp;
11361 
11362  /* "View.MemoryView":460
11363  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11364  *
11365  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11366  * tmp = PyMem_Malloc(self.view.itemsize)
11367  * if tmp == NULL:
11368  */
11369  goto __pyx_L3;
11370  }
11371 
11372  /* "View.MemoryView":466
11373  * item = tmp
11374  * else:
11375  * item = <void *> array # <<<<<<<<<<<<<<
11376  *
11377  * try:
11378  */
11379  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11380  /*else*/ {
11381  __pyx_v_item = ((void *)__pyx_v_array);
11382  }
11383  __pyx_L3:;
11384 
11385  /* "View.MemoryView":468
11386  * item = <void *> array
11387  *
11388  * try: # <<<<<<<<<<<<<<
11389  * if self.dtype_is_object:
11390  * (<PyObject **> item)[0] = <PyObject *> value
11391  */
11392  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
11393  /*try:*/ {
11394 
11395  /* "View.MemoryView":469
11396  *
11397  * try:
11398  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11399  * (<PyObject **> item)[0] = <PyObject *> value
11400  * else:
11401  */
11402  __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
11403  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11404  if (__pyx_t_2) {
11405 
11406  /* "View.MemoryView":470
11407  * try:
11408  * if self.dtype_is_object:
11409  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11410  * else:
11411  * self.assign_item_from_object(<char *> item, value)
11412  */
11413  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11414  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11415 
11416  /* "View.MemoryView":469
11417  *
11418  * try:
11419  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11420  * (<PyObject **> item)[0] = <PyObject *> value
11421  * else:
11422  */
11423  goto __pyx_L8;
11424  }
11425 
11426  /* "View.MemoryView":472
11427  * (<PyObject **> item)[0] = <PyObject *> value
11428  * else:
11429  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11430  *
11431  *
11432  */
11433  __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
11434  /*else*/ {
11435  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
11436  __Pyx_GOTREF(__pyx_t_3);
11437  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11438  }
11439  __pyx_L8:;
11440 
11441  /* "View.MemoryView":476
11442  *
11443  *
11444  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11445  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11446  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11447  */
11448  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11449  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11450  if (__pyx_t_2) {
11451 
11452  /* "View.MemoryView":477
11453  *
11454  * if self.view.suboffsets != NULL:
11455  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11456  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11457  * item, self.dtype_is_object)
11458  */
11459  __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
11460  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
11461  __Pyx_GOTREF(__pyx_t_3);
11462  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11463 
11464  /* "View.MemoryView":476
11465  *
11466  *
11467  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11468  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11469  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11470  */
11471  }
11472 
11473  /* "View.MemoryView":478
11474  * if self.view.suboffsets != NULL:
11475  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11476  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11477  * item, self.dtype_is_object)
11478  * finally:
11479  */
11480  __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
11481  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11482  }
11483 
11484  /* "View.MemoryView":481
11485  * item, self.dtype_is_object)
11486  * finally:
11487  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11488  *
11489  * cdef setitem_indexed(self, index, value):
11490  */
11491  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
11492  /*finally:*/ {
11493  /*normal exit:*/{
11494  PyMem_Free(__pyx_v_tmp);
11495  goto __pyx_L7;
11496  }
11497  __pyx_L6_error:;
11498  /*exception exit:*/{
11499  __Pyx_PyThreadState_declare
11500  __Pyx_PyThreadState_assign
11501  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11502  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11503  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11504  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11505  __Pyx_XGOTREF(__pyx_t_7);
11506  __Pyx_XGOTREF(__pyx_t_8);
11507  __Pyx_XGOTREF(__pyx_t_9);
11508  __Pyx_XGOTREF(__pyx_t_10);
11509  __Pyx_XGOTREF(__pyx_t_11);
11510  __Pyx_XGOTREF(__pyx_t_12);
11511  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11512  {
11513  PyMem_Free(__pyx_v_tmp);
11514  }
11515  if (PY_MAJOR_VERSION >= 3) {
11516  __Pyx_XGIVEREF(__pyx_t_10);
11517  __Pyx_XGIVEREF(__pyx_t_11);
11518  __Pyx_XGIVEREF(__pyx_t_12);
11519  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11520  }
11521  __Pyx_XGIVEREF(__pyx_t_7);
11522  __Pyx_XGIVEREF(__pyx_t_8);
11523  __Pyx_XGIVEREF(__pyx_t_9);
11524  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11525  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11526  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11527  goto __pyx_L1_error;
11528  }
11529  __pyx_L7:;
11530  }
11531 
11532  /* "View.MemoryView":451
11533  * src.ndim, dst.ndim, self.dtype_is_object)
11534  *
11535  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11536  * cdef int array[128]
11537  * cdef void *tmp = NULL
11538  */
11539 
11540  /* function exit code */
11541  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11542  goto __pyx_L0;
11543  __pyx_L1_error:;
11544  __Pyx_XDECREF(__pyx_t_3);
11545  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11546  __pyx_r = 0;
11547  __pyx_L0:;
11548  __Pyx_XGIVEREF(__pyx_r);
11549  __Pyx_TraceReturn(__pyx_r, 0);
11550  __Pyx_RefNannyFinishContext();
11551  return __pyx_r;
11552 }
11553 
11554 /* "View.MemoryView":483
11555  * PyMem_Free(tmp)
11556  *
11557  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11558  * cdef char *itemp = self.get_item_pointer(index)
11559  * self.assign_item_from_object(itemp, value)
11560  */
11561 
11562 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11563  char *__pyx_v_itemp;
11564  PyObject *__pyx_r = NULL;
11565  __Pyx_TraceDeclarations
11566  __Pyx_RefNannyDeclarations
11567  char *__pyx_t_1;
11568  PyObject *__pyx_t_2 = NULL;
11569  int __pyx_lineno = 0;
11570  const char *__pyx_filename = NULL;
11571  int __pyx_clineno = 0;
11572  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11573  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
11574 
11575  /* "View.MemoryView":484
11576  *
11577  * cdef setitem_indexed(self, index, value):
11578  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11579  * self.assign_item_from_object(itemp, value)
11580  *
11581  */
11582  __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
11583  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
11584  __pyx_v_itemp = __pyx_t_1;
11585 
11586  /* "View.MemoryView":485
11587  * cdef setitem_indexed(self, index, value):
11588  * cdef char *itemp = self.get_item_pointer(index)
11589  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11590  *
11591  * cdef convert_item_to_object(self, char *itemp):
11592  */
11593  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
11594  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
11595  __Pyx_GOTREF(__pyx_t_2);
11596  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11597 
11598  /* "View.MemoryView":483
11599  * PyMem_Free(tmp)
11600  *
11601  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11602  * cdef char *itemp = self.get_item_pointer(index)
11603  * self.assign_item_from_object(itemp, value)
11604  */
11605 
11606  /* function exit code */
11607  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11608  goto __pyx_L0;
11609  __pyx_L1_error:;
11610  __Pyx_XDECREF(__pyx_t_2);
11611  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11612  __pyx_r = 0;
11613  __pyx_L0:;
11614  __Pyx_XGIVEREF(__pyx_r);
11615  __Pyx_TraceReturn(__pyx_r, 0);
11616  __Pyx_RefNannyFinishContext();
11617  return __pyx_r;
11618 }
11619 
11620 /* "View.MemoryView":487
11621  * self.assign_item_from_object(itemp, value)
11622  *
11623  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11624  * """Only used if instantiated manually by the user, or if Cython doesn't
11625  * know how to convert the type"""
11626  */
11627 
11628 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11629  PyObject *__pyx_v_struct = NULL;
11630  PyObject *__pyx_v_bytesitem = 0;
11631  PyObject *__pyx_v_result = NULL;
11632  PyObject *__pyx_r = NULL;
11633  __Pyx_TraceDeclarations
11634  __Pyx_RefNannyDeclarations
11635  PyObject *__pyx_t_1 = NULL;
11636  PyObject *__pyx_t_2 = NULL;
11637  PyObject *__pyx_t_3 = NULL;
11638  PyObject *__pyx_t_4 = NULL;
11639  PyObject *__pyx_t_5 = NULL;
11640  PyObject *__pyx_t_6 = NULL;
11641  PyObject *__pyx_t_7 = NULL;
11642  int __pyx_t_8;
11643  PyObject *__pyx_t_9 = NULL;
11644  size_t __pyx_t_10;
11645  int __pyx_t_11;
11646  int __pyx_lineno = 0;
11647  const char *__pyx_filename = NULL;
11648  int __pyx_clineno = 0;
11649  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11650  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
11651 
11652  /* "View.MemoryView":490
11653  * """Only used if instantiated manually by the user, or if Cython doesn't
11654  * know how to convert the type"""
11655  * import struct # <<<<<<<<<<<<<<
11656  * cdef bytes bytesitem
11657  *
11658  */
11659  __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
11660  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
11661  __Pyx_GOTREF(__pyx_t_1);
11662  __pyx_v_struct = __pyx_t_1;
11663  __pyx_t_1 = 0;
11664 
11665  /* "View.MemoryView":493
11666  * cdef bytes bytesitem
11667  *
11668  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11669  * try:
11670  * result = struct.unpack(self.view.format, bytesitem)
11671  */
11672  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
11673  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
11674  __Pyx_GOTREF(__pyx_t_1);
11675  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11676  __pyx_t_1 = 0;
11677 
11678  /* "View.MemoryView":494
11679  *
11680  * bytesitem = itemp[:self.view.itemsize]
11681  * try: # <<<<<<<<<<<<<<
11682  * result = struct.unpack(self.view.format, bytesitem)
11683  * except struct.error:
11684  */
11685  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
11686  {
11687  __Pyx_PyThreadState_declare
11688  __Pyx_PyThreadState_assign
11689  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11690  __Pyx_XGOTREF(__pyx_t_2);
11691  __Pyx_XGOTREF(__pyx_t_3);
11692  __Pyx_XGOTREF(__pyx_t_4);
11693  /*try:*/ {
11694 
11695  /* "View.MemoryView":495
11696  * bytesitem = itemp[:self.view.itemsize]
11697  * try:
11698  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11699  * except struct.error:
11700  * raise ValueError("Unable to convert item to object")
11701  */
11702  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
11703  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
11704  __Pyx_GOTREF(__pyx_t_5);
11705  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
11706  __Pyx_GOTREF(__pyx_t_6);
11707  __pyx_t_7 = NULL;
11708  __pyx_t_8 = 0;
11709  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11710  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11711  if (likely(__pyx_t_7)) {
11712  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11713  __Pyx_INCREF(__pyx_t_7);
11714  __Pyx_INCREF(function);
11715  __Pyx_DECREF_SET(__pyx_t_5, function);
11716  __pyx_t_8 = 1;
11717  }
11718  }
11719  #if CYTHON_FAST_PYCALL
11720  if (PyFunction_Check(__pyx_t_5)) {
11721  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11722  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11723  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11724  __Pyx_GOTREF(__pyx_t_1);
11725  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11726  } else
11727  #endif
11728  #if CYTHON_FAST_PYCCALL
11729  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11730  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11731  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11732  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11733  __Pyx_GOTREF(__pyx_t_1);
11734  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11735  } else
11736  #endif
11737  {
11738  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
11739  __Pyx_GOTREF(__pyx_t_9);
11740  if (__pyx_t_7) {
11741  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11742  }
11743  __Pyx_GIVEREF(__pyx_t_6);
11744  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11745  __Pyx_INCREF(__pyx_v_bytesitem);
11746  __Pyx_GIVEREF(__pyx_v_bytesitem);
11747  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11748  __pyx_t_6 = 0;
11749  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11750  __Pyx_GOTREF(__pyx_t_1);
11751  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11752  }
11753  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11754  __pyx_v_result = __pyx_t_1;
11755  __pyx_t_1 = 0;
11756 
11757  /* "View.MemoryView":494
11758  *
11759  * bytesitem = itemp[:self.view.itemsize]
11760  * try: # <<<<<<<<<<<<<<
11761  * result = struct.unpack(self.view.format, bytesitem)
11762  * except struct.error:
11763  */
11764  }
11765 
11766  /* "View.MemoryView":499
11767  * raise ValueError("Unable to convert item to object")
11768  * else:
11769  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11770  * return result[0]
11771  * return result
11772  */
11773  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11774  /*else:*/ {
11775  __pyx_t_10 = strlen(__pyx_v_self->view.format);
11776  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11777  if (__pyx_t_11) {
11778 
11779  /* "View.MemoryView":500
11780  * else:
11781  * if len(self.view.format) == 1:
11782  * return result[0] # <<<<<<<<<<<<<<
11783  * return result
11784  *
11785  */
11786  __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11787  __Pyx_XDECREF(__pyx_r);
11788  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11789  __Pyx_GOTREF(__pyx_t_1);
11790  __pyx_r = __pyx_t_1;
11791  __pyx_t_1 = 0;
11792  goto __pyx_L6_except_return;
11793 
11794  /* "View.MemoryView":499
11795  * raise ValueError("Unable to convert item to object")
11796  * else:
11797  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11798  * return result[0]
11799  * return result
11800  */
11801  }
11802 
11803  /* "View.MemoryView":501
11804  * if len(self.view.format) == 1:
11805  * return result[0]
11806  * return result # <<<<<<<<<<<<<<
11807  *
11808  * cdef assign_item_from_object(self, char *itemp, object value):
11809  */
11810  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11811  __Pyx_XDECREF(__pyx_r);
11812  __Pyx_INCREF(__pyx_v_result);
11813  __pyx_r = __pyx_v_result;
11814  goto __pyx_L6_except_return;
11815  }
11816  __pyx_L3_error:;
11817  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11818  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11819  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11820  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11821  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11822 
11823  /* "View.MemoryView":496
11824  * try:
11825  * result = struct.unpack(self.view.format, bytesitem)
11826  * except struct.error: # <<<<<<<<<<<<<<
11827  * raise ValueError("Unable to convert item to object")
11828  * else:
11829  */
11830  __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11831  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11832  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11833  __Pyx_GOTREF(__pyx_t_6);
11834  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11835  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11836  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11837  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11838  if (__pyx_t_8) {
11839  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11840  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11841  __Pyx_GOTREF(__pyx_t_9);
11842  __Pyx_GOTREF(__pyx_t_5);
11843  __Pyx_GOTREF(__pyx_t_1);
11844 
11845  /* "View.MemoryView":497
11846  * result = struct.unpack(self.view.format, bytesitem)
11847  * except struct.error:
11848  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
11849  * else:
11850  * if len(self.view.format) == 1:
11851  */
11852  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11853  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11854  __Pyx_GOTREF(__pyx_t_6);
11855  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11856  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11857  __PYX_ERR(1, 497, __pyx_L5_except_error)
11858  }
11859  goto __pyx_L5_except_error;
11860  __pyx_L5_except_error:;
11861 
11862  /* "View.MemoryView":494
11863  *
11864  * bytesitem = itemp[:self.view.itemsize]
11865  * try: # <<<<<<<<<<<<<<
11866  * result = struct.unpack(self.view.format, bytesitem)
11867  * except struct.error:
11868  */
11869  __Pyx_XGIVEREF(__pyx_t_2);
11870  __Pyx_XGIVEREF(__pyx_t_3);
11871  __Pyx_XGIVEREF(__pyx_t_4);
11872  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11873  goto __pyx_L1_error;
11874  __pyx_L6_except_return:;
11875  __Pyx_XGIVEREF(__pyx_t_2);
11876  __Pyx_XGIVEREF(__pyx_t_3);
11877  __Pyx_XGIVEREF(__pyx_t_4);
11878  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11879  goto __pyx_L0;
11880  }
11881 
11882  /* "View.MemoryView":487
11883  * self.assign_item_from_object(itemp, value)
11884  *
11885  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11886  * """Only used if instantiated manually by the user, or if Cython doesn't
11887  * know how to convert the type"""
11888  */
11889 
11890  /* function exit code */
11891  __pyx_L1_error:;
11892  __Pyx_XDECREF(__pyx_t_1);
11893  __Pyx_XDECREF(__pyx_t_5);
11894  __Pyx_XDECREF(__pyx_t_6);
11895  __Pyx_XDECREF(__pyx_t_7);
11896  __Pyx_XDECREF(__pyx_t_9);
11897  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11898  __pyx_r = 0;
11899  __pyx_L0:;
11900  __Pyx_XDECREF(__pyx_v_struct);
11901  __Pyx_XDECREF(__pyx_v_bytesitem);
11902  __Pyx_XDECREF(__pyx_v_result);
11903  __Pyx_XGIVEREF(__pyx_r);
11904  __Pyx_TraceReturn(__pyx_r, 0);
11905  __Pyx_RefNannyFinishContext();
11906  return __pyx_r;
11907 }
11908 
11909 /* "View.MemoryView":503
11910  * return result
11911  *
11912  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11913  * """Only used if instantiated manually by the user, or if Cython doesn't
11914  * know how to convert the type"""
11915  */
11916 
11917 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11918  PyObject *__pyx_v_struct = NULL;
11919  char __pyx_v_c;
11920  PyObject *__pyx_v_bytesvalue = 0;
11921  Py_ssize_t __pyx_v_i;
11922  PyObject *__pyx_r = NULL;
11923  __Pyx_TraceDeclarations
11924  __Pyx_RefNannyDeclarations
11925  PyObject *__pyx_t_1 = NULL;
11926  int __pyx_t_2;
11927  int __pyx_t_3;
11928  PyObject *__pyx_t_4 = NULL;
11929  PyObject *__pyx_t_5 = NULL;
11930  PyObject *__pyx_t_6 = NULL;
11931  int __pyx_t_7;
11932  PyObject *__pyx_t_8 = NULL;
11933  Py_ssize_t __pyx_t_9;
11934  PyObject *__pyx_t_10 = NULL;
11935  char *__pyx_t_11;
11936  char *__pyx_t_12;
11937  char *__pyx_t_13;
11938  char *__pyx_t_14;
11939  int __pyx_lineno = 0;
11940  const char *__pyx_filename = NULL;
11941  int __pyx_clineno = 0;
11942  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
11943  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11944 
11945  /* "View.MemoryView":506
11946  * """Only used if instantiated manually by the user, or if Cython doesn't
11947  * know how to convert the type"""
11948  * import struct # <<<<<<<<<<<<<<
11949  * cdef char c
11950  * cdef bytes bytesvalue
11951  */
11952  __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11953  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11954  __Pyx_GOTREF(__pyx_t_1);
11955  __pyx_v_struct = __pyx_t_1;
11956  __pyx_t_1 = 0;
11957 
11958  /* "View.MemoryView":511
11959  * cdef Py_ssize_t i
11960  *
11961  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11962  * bytesvalue = struct.pack(self.view.format, *value)
11963  * else:
11964  */
11965  __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11966  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11967  __pyx_t_3 = (__pyx_t_2 != 0);
11968  if (__pyx_t_3) {
11969 
11970  /* "View.MemoryView":512
11971  *
11972  * if isinstance(value, tuple):
11973  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11974  * else:
11975  * bytesvalue = struct.pack(self.view.format, value)
11976  */
11977  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11978  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11979  __Pyx_GOTREF(__pyx_t_1);
11980  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11981  __Pyx_GOTREF(__pyx_t_4);
11982  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11983  __Pyx_GOTREF(__pyx_t_5);
11984  __Pyx_GIVEREF(__pyx_t_4);
11985  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11986  __pyx_t_4 = 0;
11987  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11988  __Pyx_GOTREF(__pyx_t_4);
11989  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11990  __Pyx_GOTREF(__pyx_t_6);
11991  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11992  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11993  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11994  __Pyx_GOTREF(__pyx_t_4);
11995  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11996  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11997  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11998  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11999  __pyx_t_4 = 0;
12000 
12001  /* "View.MemoryView":511
12002  * cdef Py_ssize_t i
12003  *
12004  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12005  * bytesvalue = struct.pack(self.view.format, *value)
12006  * else:
12007  */
12008  goto __pyx_L3;
12009  }
12010 
12011  /* "View.MemoryView":514
12012  * bytesvalue = struct.pack(self.view.format, *value)
12013  * else:
12014  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12015  *
12016  * for i, c in enumerate(bytesvalue):
12017  */
12018  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
12019  /*else*/ {
12020  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
12021  __Pyx_GOTREF(__pyx_t_6);
12022  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
12023  __Pyx_GOTREF(__pyx_t_1);
12024  __pyx_t_5 = NULL;
12025  __pyx_t_7 = 0;
12026  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12027  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12028  if (likely(__pyx_t_5)) {
12029  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12030  __Pyx_INCREF(__pyx_t_5);
12031  __Pyx_INCREF(function);
12032  __Pyx_DECREF_SET(__pyx_t_6, function);
12033  __pyx_t_7 = 1;
12034  }
12035  }
12036  #if CYTHON_FAST_PYCALL
12037  if (PyFunction_Check(__pyx_t_6)) {
12038  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12039  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12040  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12041  __Pyx_GOTREF(__pyx_t_4);
12042  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12043  } else
12044  #endif
12045  #if CYTHON_FAST_PYCCALL
12046  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12047  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12048  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12049  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12050  __Pyx_GOTREF(__pyx_t_4);
12051  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12052  } else
12053  #endif
12054  {
12055  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
12056  __Pyx_GOTREF(__pyx_t_8);
12057  if (__pyx_t_5) {
12058  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12059  }
12060  __Pyx_GIVEREF(__pyx_t_1);
12061  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12062  __Pyx_INCREF(__pyx_v_value);
12063  __Pyx_GIVEREF(__pyx_v_value);
12064  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12065  __pyx_t_1 = 0;
12066  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12067  __Pyx_GOTREF(__pyx_t_4);
12068  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12069  }
12070  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12071  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
12072  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12073  __pyx_t_4 = 0;
12074  }
12075  __pyx_L3:;
12076 
12077  /* "View.MemoryView":516
12078  * bytesvalue = struct.pack(self.view.format, value)
12079  *
12080  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12081  * itemp[i] = c
12082  *
12083  */
12084  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12085  __pyx_t_9 = 0;
12086  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12087  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12088  __PYX_ERR(1, 516, __pyx_L1_error)
12089  }
12090  __Pyx_INCREF(__pyx_v_bytesvalue);
12091  __pyx_t_10 = __pyx_v_bytesvalue;
12092  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12093  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12094  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12095  __pyx_t_11 = __pyx_t_14;
12096  __pyx_v_c = (__pyx_t_11[0]);
12097 
12098  /* "View.MemoryView":517
12099  *
12100  * for i, c in enumerate(bytesvalue):
12101  * itemp[i] = c # <<<<<<<<<<<<<<
12102  *
12103  * @cname('getbuffer')
12104  */
12105  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12106  __pyx_v_i = __pyx_t_9;
12107 
12108  /* "View.MemoryView":516
12109  * bytesvalue = struct.pack(self.view.format, value)
12110  *
12111  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12112  * itemp[i] = c
12113  *
12114  */
12115  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12116  __pyx_t_9 = (__pyx_t_9 + 1);
12117 
12118  /* "View.MemoryView":517
12119  *
12120  * for i, c in enumerate(bytesvalue):
12121  * itemp[i] = c # <<<<<<<<<<<<<<
12122  *
12123  * @cname('getbuffer')
12124  */
12125  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12126  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12127  }
12128  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12129 
12130  /* "View.MemoryView":503
12131  * return result
12132  *
12133  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12134  * """Only used if instantiated manually by the user, or if Cython doesn't
12135  * know how to convert the type"""
12136  */
12137 
12138  /* function exit code */
12139  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12140  goto __pyx_L0;
12141  __pyx_L1_error:;
12142  __Pyx_XDECREF(__pyx_t_1);
12143  __Pyx_XDECREF(__pyx_t_4);
12144  __Pyx_XDECREF(__pyx_t_5);
12145  __Pyx_XDECREF(__pyx_t_6);
12146  __Pyx_XDECREF(__pyx_t_8);
12147  __Pyx_XDECREF(__pyx_t_10);
12148  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12149  __pyx_r = 0;
12150  __pyx_L0:;
12151  __Pyx_XDECREF(__pyx_v_struct);
12152  __Pyx_XDECREF(__pyx_v_bytesvalue);
12153  __Pyx_XGIVEREF(__pyx_r);
12154  __Pyx_TraceReturn(__pyx_r, 0);
12155  __Pyx_RefNannyFinishContext();
12156  return __pyx_r;
12157 }
12158 
12159 /* "View.MemoryView":520
12160  *
12161  * @cname('getbuffer')
12162  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12163  * if flags & PyBUF_WRITABLE and self.view.readonly:
12164  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12165  */
12166 
12167 /* Python wrapper */
12168 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12169 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12170  int __pyx_r;
12171  __Pyx_RefNannyDeclarations
12172  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12173  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12174 
12175  /* function exit code */
12176  __Pyx_RefNannyFinishContext();
12177  return __pyx_r;
12178 }
12179 
12180 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12181  int __pyx_r;
12182  __Pyx_TraceDeclarations
12183  __Pyx_RefNannyDeclarations
12184  int __pyx_t_1;
12185  int __pyx_t_2;
12186  PyObject *__pyx_t_3 = NULL;
12187  Py_ssize_t *__pyx_t_4;
12188  char *__pyx_t_5;
12189  void *__pyx_t_6;
12190  int __pyx_t_7;
12191  Py_ssize_t __pyx_t_8;
12192  int __pyx_lineno = 0;
12193  const char *__pyx_filename = NULL;
12194  int __pyx_clineno = 0;
12195  if (__pyx_v_info == NULL) {
12196  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12197  return -1;
12198  }
12199  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12200  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12201  __Pyx_GIVEREF(__pyx_v_info->obj);
12202  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
12203 
12204  /* "View.MemoryView":521
12205  * @cname('getbuffer')
12206  * def __getbuffer__(self, Py_buffer *info, int flags):
12207  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12208  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12209  *
12210  */
12211  __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
12212  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12213  if (__pyx_t_2) {
12214  } else {
12215  __pyx_t_1 = __pyx_t_2;
12216  goto __pyx_L4_bool_binop_done;
12217  }
12218  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12219  __pyx_t_1 = __pyx_t_2;
12220  __pyx_L4_bool_binop_done:;
12221  if (unlikely(__pyx_t_1)) {
12222 
12223  /* "View.MemoryView":522
12224  * def __getbuffer__(self, Py_buffer *info, int flags):
12225  * if flags & PyBUF_WRITABLE and self.view.readonly:
12226  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12227  *
12228  * if flags & PyBUF_ND:
12229  */
12230  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
12231  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
12232  __Pyx_GOTREF(__pyx_t_3);
12233  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12234  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12235  __PYX_ERR(1, 522, __pyx_L1_error)
12236 
12237  /* "View.MemoryView":521
12238  * @cname('getbuffer')
12239  * def __getbuffer__(self, Py_buffer *info, int flags):
12240  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12241  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12242  *
12243  */
12244  }
12245 
12246  /* "View.MemoryView":524
12247  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12248  *
12249  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12250  * info.shape = self.view.shape
12251  * else:
12252  */
12253  __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
12254  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12255  if (__pyx_t_1) {
12256 
12257  /* "View.MemoryView":525
12258  *
12259  * if flags & PyBUF_ND:
12260  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12261  * else:
12262  * info.shape = NULL
12263  */
12264  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
12265  __pyx_t_4 = __pyx_v_self->view.shape;
12266  __pyx_v_info->shape = __pyx_t_4;
12267 
12268  /* "View.MemoryView":524
12269  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12270  *
12271  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12272  * info.shape = self.view.shape
12273  * else:
12274  */
12275  goto __pyx_L6;
12276  }
12277 
12278  /* "View.MemoryView":527
12279  * info.shape = self.view.shape
12280  * else:
12281  * info.shape = NULL # <<<<<<<<<<<<<<
12282  *
12283  * if flags & PyBUF_STRIDES:
12284  */
12285  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
12286  /*else*/ {
12287  __pyx_v_info->shape = NULL;
12288  }
12289  __pyx_L6:;
12290 
12291  /* "View.MemoryView":529
12292  * info.shape = NULL
12293  *
12294  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12295  * info.strides = self.view.strides
12296  * else:
12297  */
12298  __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
12299  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12300  if (__pyx_t_1) {
12301 
12302  /* "View.MemoryView":530
12303  *
12304  * if flags & PyBUF_STRIDES:
12305  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12306  * else:
12307  * info.strides = NULL
12308  */
12309  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12310  __pyx_t_4 = __pyx_v_self->view.strides;
12311  __pyx_v_info->strides = __pyx_t_4;
12312 
12313  /* "View.MemoryView":529
12314  * info.shape = NULL
12315  *
12316  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12317  * info.strides = self.view.strides
12318  * else:
12319  */
12320  goto __pyx_L7;
12321  }
12322 
12323  /* "View.MemoryView":532
12324  * info.strides = self.view.strides
12325  * else:
12326  * info.strides = NULL # <<<<<<<<<<<<<<
12327  *
12328  * if flags & PyBUF_INDIRECT:
12329  */
12330  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12331  /*else*/ {
12332  __pyx_v_info->strides = NULL;
12333  }
12334  __pyx_L7:;
12335 
12336  /* "View.MemoryView":534
12337  * info.strides = NULL
12338  *
12339  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12340  * info.suboffsets = self.view.suboffsets
12341  * else:
12342  */
12343  __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
12344  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12345  if (__pyx_t_1) {
12346 
12347  /* "View.MemoryView":535
12348  *
12349  * if flags & PyBUF_INDIRECT:
12350  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12351  * else:
12352  * info.suboffsets = NULL
12353  */
12354  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12355  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12356  __pyx_v_info->suboffsets = __pyx_t_4;
12357 
12358  /* "View.MemoryView":534
12359  * info.strides = NULL
12360  *
12361  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12362  * info.suboffsets = self.view.suboffsets
12363  * else:
12364  */
12365  goto __pyx_L8;
12366  }
12367 
12368  /* "View.MemoryView":537
12369  * info.suboffsets = self.view.suboffsets
12370  * else:
12371  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12372  *
12373  * if flags & PyBUF_FORMAT:
12374  */
12375  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12376  /*else*/ {
12377  __pyx_v_info->suboffsets = NULL;
12378  }
12379  __pyx_L8:;
12380 
12381  /* "View.MemoryView":539
12382  * info.suboffsets = NULL
12383  *
12384  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12385  * info.format = self.view.format
12386  * else:
12387  */
12388  __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
12389  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12390  if (__pyx_t_1) {
12391 
12392  /* "View.MemoryView":540
12393  *
12394  * if flags & PyBUF_FORMAT:
12395  * info.format = self.view.format # <<<<<<<<<<<<<<
12396  * else:
12397  * info.format = NULL
12398  */
12399  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12400  __pyx_t_5 = __pyx_v_self->view.format;
12401  __pyx_v_info->format = __pyx_t_5;
12402 
12403  /* "View.MemoryView":539
12404  * info.suboffsets = NULL
12405  *
12406  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12407  * info.format = self.view.format
12408  * else:
12409  */
12410  goto __pyx_L9;
12411  }
12412 
12413  /* "View.MemoryView":542
12414  * info.format = self.view.format
12415  * else:
12416  * info.format = NULL # <<<<<<<<<<<<<<
12417  *
12418  * info.buf = self.view.buf
12419  */
12420  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12421  /*else*/ {
12422  __pyx_v_info->format = NULL;
12423  }
12424  __pyx_L9:;
12425 
12426  /* "View.MemoryView":544
12427  * info.format = NULL
12428  *
12429  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12430  * info.ndim = self.view.ndim
12431  * info.itemsize = self.view.itemsize
12432  */
12433  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12434  __pyx_t_6 = __pyx_v_self->view.buf;
12435  __pyx_v_info->buf = __pyx_t_6;
12436 
12437  /* "View.MemoryView":545
12438  *
12439  * info.buf = self.view.buf
12440  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12441  * info.itemsize = self.view.itemsize
12442  * info.len = self.view.len
12443  */
12444  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12445  __pyx_t_7 = __pyx_v_self->view.ndim;
12446  __pyx_v_info->ndim = __pyx_t_7;
12447 
12448  /* "View.MemoryView":546
12449  * info.buf = self.view.buf
12450  * info.ndim = self.view.ndim
12451  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12452  * info.len = self.view.len
12453  * info.readonly = self.view.readonly
12454  */
12455  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12456  __pyx_t_8 = __pyx_v_self->view.itemsize;
12457  __pyx_v_info->itemsize = __pyx_t_8;
12458 
12459  /* "View.MemoryView":547
12460  * info.ndim = self.view.ndim
12461  * info.itemsize = self.view.itemsize
12462  * info.len = self.view.len # <<<<<<<<<<<<<<
12463  * info.readonly = self.view.readonly
12464  * info.obj = self
12465  */
12466  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12467  __pyx_t_8 = __pyx_v_self->view.len;
12468  __pyx_v_info->len = __pyx_t_8;
12469 
12470  /* "View.MemoryView":548
12471  * info.itemsize = self.view.itemsize
12472  * info.len = self.view.len
12473  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12474  * info.obj = self
12475  *
12476  */
12477  __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
12478  __pyx_t_1 = __pyx_v_self->view.readonly;
12479  __pyx_v_info->readonly = __pyx_t_1;
12480 
12481  /* "View.MemoryView":549
12482  * info.len = self.view.len
12483  * info.readonly = self.view.readonly
12484  * info.obj = self # <<<<<<<<<<<<<<
12485  *
12486  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12487  */
12488  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
12489  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12490  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12491  __Pyx_GOTREF(__pyx_v_info->obj);
12492  __Pyx_DECREF(__pyx_v_info->obj);
12493  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12494 
12495  /* "View.MemoryView":520
12496  *
12497  * @cname('getbuffer')
12498  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12499  * if flags & PyBUF_WRITABLE and self.view.readonly:
12500  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12501  */
12502 
12503  /* function exit code */
12504  __pyx_r = 0;
12505  goto __pyx_L0;
12506  __pyx_L1_error:;
12507  __Pyx_XDECREF(__pyx_t_3);
12508  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12509  __pyx_r = -1;
12510  if (__pyx_v_info->obj != NULL) {
12511  __Pyx_GOTREF(__pyx_v_info->obj);
12512  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12513  }
12514  goto __pyx_L2;
12515  __pyx_L0:;
12516  if (__pyx_v_info->obj == Py_None) {
12517  __Pyx_GOTREF(__pyx_v_info->obj);
12518  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12519  }
12520  __pyx_L2:;
12521  __Pyx_TraceReturn(Py_None, 0);
12522  __Pyx_RefNannyFinishContext();
12523  return __pyx_r;
12524 }
12525 
12526 /* "View.MemoryView":555
12527  *
12528  * @property
12529  * def T(self): # <<<<<<<<<<<<<<
12530  * cdef _memoryviewslice result = memoryview_copy(self)
12531  * transpose_memslice(&result.from_slice)
12532  */
12533 
12534 /* Python wrapper */
12535 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12537  PyObject *__pyx_r = 0;
12538  __Pyx_RefNannyDeclarations
12539  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12540  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12541 
12542  /* function exit code */
12543  __Pyx_RefNannyFinishContext();
12544  return __pyx_r;
12545 }
12546 
12547 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12548  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12549  PyObject *__pyx_r = NULL;
12550  __Pyx_TraceDeclarations
12551  __Pyx_RefNannyDeclarations
12552  PyObject *__pyx_t_1 = NULL;
12553  int __pyx_t_2;
12554  int __pyx_lineno = 0;
12555  const char *__pyx_filename = NULL;
12556  int __pyx_clineno = 0;
12557  __Pyx_RefNannySetupContext("__get__", 0);
12558  __Pyx_TraceCall("__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
12559 
12560  /* "View.MemoryView":556
12561  * @property
12562  * def T(self):
12563  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12564  * transpose_memslice(&result.from_slice)
12565  * return result
12566  */
12567  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12568  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
12569  __Pyx_GOTREF(__pyx_t_1);
12570  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
12571  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12572  __pyx_t_1 = 0;
12573 
12574  /* "View.MemoryView":557
12575  * def T(self):
12576  * cdef _memoryviewslice result = memoryview_copy(self)
12577  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12578  * return result
12579  *
12580  */
12581  __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
12582  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
12583 
12584  /* "View.MemoryView":558
12585  * cdef _memoryviewslice result = memoryview_copy(self)
12586  * transpose_memslice(&result.from_slice)
12587  * return result # <<<<<<<<<<<<<<
12588  *
12589  * @property
12590  */
12591  __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
12592  __Pyx_XDECREF(__pyx_r);
12593  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12594  __pyx_r = ((PyObject *)__pyx_v_result);
12595  goto __pyx_L0;
12596 
12597  /* "View.MemoryView":555
12598  *
12599  * @property
12600  * def T(self): # <<<<<<<<<<<<<<
12601  * cdef _memoryviewslice result = memoryview_copy(self)
12602  * transpose_memslice(&result.from_slice)
12603  */
12604 
12605  /* function exit code */
12606  __pyx_L1_error:;
12607  __Pyx_XDECREF(__pyx_t_1);
12608  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12609  __pyx_r = NULL;
12610  __pyx_L0:;
12611  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12612  __Pyx_XGIVEREF(__pyx_r);
12613  __Pyx_TraceReturn(__pyx_r, 0);
12614  __Pyx_RefNannyFinishContext();
12615  return __pyx_r;
12616 }
12617 
12618 /* "View.MemoryView":561
12619  *
12620  * @property
12621  * def base(self): # <<<<<<<<<<<<<<
12622  * return self.obj
12623  *
12624  */
12625 
12626 /* Python wrapper */
12627 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12628 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12629  PyObject *__pyx_r = 0;
12630  __Pyx_RefNannyDeclarations
12631  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12632  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12633 
12634  /* function exit code */
12635  __Pyx_RefNannyFinishContext();
12636  return __pyx_r;
12637 }
12638 
12639 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12640  PyObject *__pyx_r = NULL;
12641  __Pyx_TraceDeclarations
12642  __Pyx_RefNannyDeclarations
12643  int __pyx_lineno = 0;
12644  const char *__pyx_filename = NULL;
12645  int __pyx_clineno = 0;
12646  __Pyx_RefNannySetupContext("__get__", 0);
12647  __Pyx_TraceCall("__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
12648 
12649  /* "View.MemoryView":562
12650  * @property
12651  * def base(self):
12652  * return self.obj # <<<<<<<<<<<<<<
12653  *
12654  * @property
12655  */
12656  __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
12657  __Pyx_XDECREF(__pyx_r);
12658  __Pyx_INCREF(__pyx_v_self->obj);
12659  __pyx_r = __pyx_v_self->obj;
12660  goto __pyx_L0;
12661 
12662  /* "View.MemoryView":561
12663  *
12664  * @property
12665  * def base(self): # <<<<<<<<<<<<<<
12666  * return self.obj
12667  *
12668  */
12669 
12670  /* function exit code */
12671  __pyx_L1_error:;
12672  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12673  __pyx_r = NULL;
12674  __pyx_L0:;
12675  __Pyx_XGIVEREF(__pyx_r);
12676  __Pyx_TraceReturn(__pyx_r, 0);
12677  __Pyx_RefNannyFinishContext();
12678  return __pyx_r;
12679 }
12680 
12681 /* "View.MemoryView":565
12682  *
12683  * @property
12684  * def shape(self): # <<<<<<<<<<<<<<
12685  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12686  *
12687  */
12688 
12689 /* Python wrapper */
12690 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12691 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12692  PyObject *__pyx_r = 0;
12693  __Pyx_RefNannyDeclarations
12694  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12695  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12696 
12697  /* function exit code */
12698  __Pyx_RefNannyFinishContext();
12699  return __pyx_r;
12700 }
12701 
12702 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12703  Py_ssize_t __pyx_v_length;
12704  PyObject *__pyx_r = NULL;
12705  __Pyx_TraceDeclarations
12706  __Pyx_RefNannyDeclarations
12707  PyObject *__pyx_t_1 = NULL;
12708  Py_ssize_t *__pyx_t_2;
12709  Py_ssize_t *__pyx_t_3;
12710  Py_ssize_t *__pyx_t_4;
12711  PyObject *__pyx_t_5 = NULL;
12712  int __pyx_lineno = 0;
12713  const char *__pyx_filename = NULL;
12714  int __pyx_clineno = 0;
12715  __Pyx_RefNannySetupContext("__get__", 0);
12716  __Pyx_TraceCall("__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
12717 
12718  /* "View.MemoryView":566
12719  * @property
12720  * def shape(self):
12721  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12722  *
12723  * @property
12724  */
12725  __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
12726  __Pyx_XDECREF(__pyx_r);
12727  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
12728  __Pyx_GOTREF(__pyx_t_1);
12729  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12730  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12731  __pyx_t_2 = __pyx_t_4;
12732  __pyx_v_length = (__pyx_t_2[0]);
12733  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12734  __Pyx_GOTREF(__pyx_t_5);
12735  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
12736  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12737  }
12738  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12739  __Pyx_GOTREF(__pyx_t_5);
12740  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12741  __pyx_r = __pyx_t_5;
12742  __pyx_t_5 = 0;
12743  goto __pyx_L0;
12744 
12745  /* "View.MemoryView":565
12746  *
12747  * @property
12748  * def shape(self): # <<<<<<<<<<<<<<
12749  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12750  *
12751  */
12752 
12753  /* function exit code */
12754  __pyx_L1_error:;
12755  __Pyx_XDECREF(__pyx_t_1);
12756  __Pyx_XDECREF(__pyx_t_5);
12757  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12758  __pyx_r = NULL;
12759  __pyx_L0:;
12760  __Pyx_XGIVEREF(__pyx_r);
12761  __Pyx_TraceReturn(__pyx_r, 0);
12762  __Pyx_RefNannyFinishContext();
12763  return __pyx_r;
12764 }
12765 
12766 /* "View.MemoryView":569
12767  *
12768  * @property
12769  * def strides(self): # <<<<<<<<<<<<<<
12770  * if self.view.strides == NULL:
12771  *
12772  */
12773 
12774 /* Python wrapper */
12775 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
12776 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12777  PyObject *__pyx_r = 0;
12778  __Pyx_RefNannyDeclarations
12779  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12780  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12781 
12782  /* function exit code */
12783  __Pyx_RefNannyFinishContext();
12784  return __pyx_r;
12785 }
12786 
12787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12788  Py_ssize_t __pyx_v_stride;
12789  PyObject *__pyx_r = NULL;
12790  __Pyx_TraceDeclarations
12791  __Pyx_RefNannyDeclarations
12792  int __pyx_t_1;
12793  PyObject *__pyx_t_2 = NULL;
12794  Py_ssize_t *__pyx_t_3;
12795  Py_ssize_t *__pyx_t_4;
12796  Py_ssize_t *__pyx_t_5;
12797  PyObject *__pyx_t_6 = NULL;
12798  int __pyx_lineno = 0;
12799  const char *__pyx_filename = NULL;
12800  int __pyx_clineno = 0;
12801  __Pyx_RefNannySetupContext("__get__", 0);
12802  __Pyx_TraceCall("__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12803 
12804  /* "View.MemoryView":570
12805  * @property
12806  * def strides(self):
12807  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12808  *
12809  * raise ValueError("Buffer view does not expose strides")
12810  */
12811  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12812  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12813  if (unlikely(__pyx_t_1)) {
12814 
12815  /* "View.MemoryView":572
12816  * if self.view.strides == NULL:
12817  *
12818  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12819  *
12820  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12821  */
12822  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12823  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12824  __Pyx_GOTREF(__pyx_t_2);
12825  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12826  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12827  __PYX_ERR(1, 572, __pyx_L1_error)
12828 
12829  /* "View.MemoryView":570
12830  * @property
12831  * def strides(self):
12832  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12833  *
12834  * raise ValueError("Buffer view does not expose strides")
12835  */
12836  }
12837 
12838  /* "View.MemoryView":574
12839  * raise ValueError("Buffer view does not expose strides")
12840  *
12841  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
12842  *
12843  * @property
12844  */
12845  __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12846  __Pyx_XDECREF(__pyx_r);
12847  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12848  __Pyx_GOTREF(__pyx_t_2);
12849  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12850  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12851  __pyx_t_3 = __pyx_t_5;
12852  __pyx_v_stride = (__pyx_t_3[0]);
12853  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12854  __Pyx_GOTREF(__pyx_t_6);
12855  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12856  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12857  }
12858  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12859  __Pyx_GOTREF(__pyx_t_6);
12860  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12861  __pyx_r = __pyx_t_6;
12862  __pyx_t_6 = 0;
12863  goto __pyx_L0;
12864 
12865  /* "View.MemoryView":569
12866  *
12867  * @property
12868  * def strides(self): # <<<<<<<<<<<<<<
12869  * if self.view.strides == NULL:
12870  *
12871  */
12872 
12873  /* function exit code */
12874  __pyx_L1_error:;
12875  __Pyx_XDECREF(__pyx_t_2);
12876  __Pyx_XDECREF(__pyx_t_6);
12877  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12878  __pyx_r = NULL;
12879  __pyx_L0:;
12880  __Pyx_XGIVEREF(__pyx_r);
12881  __Pyx_TraceReturn(__pyx_r, 0);
12882  __Pyx_RefNannyFinishContext();
12883  return __pyx_r;
12884 }
12885 
12886 /* "View.MemoryView":577
12887  *
12888  * @property
12889  * def suboffsets(self): # <<<<<<<<<<<<<<
12890  * if self.view.suboffsets == NULL:
12891  * return (-1,) * self.view.ndim
12892  */
12893 
12894 /* Python wrapper */
12895 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
12896 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12897  PyObject *__pyx_r = 0;
12898  __Pyx_RefNannyDeclarations
12899  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12900  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12901 
12902  /* function exit code */
12903  __Pyx_RefNannyFinishContext();
12904  return __pyx_r;
12905 }
12906 
12907 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12908  Py_ssize_t __pyx_v_suboffset;
12909  PyObject *__pyx_r = NULL;
12910  __Pyx_TraceDeclarations
12911  __Pyx_RefNannyDeclarations
12912  int __pyx_t_1;
12913  PyObject *__pyx_t_2 = NULL;
12914  PyObject *__pyx_t_3 = NULL;
12915  Py_ssize_t *__pyx_t_4;
12916  Py_ssize_t *__pyx_t_5;
12917  Py_ssize_t *__pyx_t_6;
12918  int __pyx_lineno = 0;
12919  const char *__pyx_filename = NULL;
12920  int __pyx_clineno = 0;
12921  __Pyx_RefNannySetupContext("__get__", 0);
12922  __Pyx_TraceCall("__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12923 
12924  /* "View.MemoryView":578
12925  * @property
12926  * def suboffsets(self):
12927  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12928  * return (-1,) * self.view.ndim
12929  *
12930  */
12931  __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12932  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12933  if (__pyx_t_1) {
12934 
12935  /* "View.MemoryView":579
12936  * def suboffsets(self):
12937  * if self.view.suboffsets == NULL:
12938  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12939  *
12940  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12941  */
12942  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12943  __Pyx_XDECREF(__pyx_r);
12944  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12945  __Pyx_GOTREF(__pyx_t_2);
12946  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12947  __Pyx_GOTREF(__pyx_t_3);
12948  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12949  __pyx_r = __pyx_t_3;
12950  __pyx_t_3 = 0;
12951  goto __pyx_L0;
12952 
12953  /* "View.MemoryView":578
12954  * @property
12955  * def suboffsets(self):
12956  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12957  * return (-1,) * self.view.ndim
12958  *
12959  */
12960  }
12961 
12962  /* "View.MemoryView":581
12963  * return (-1,) * self.view.ndim
12964  *
12965  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12966  *
12967  * @property
12968  */
12969  __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12970  __Pyx_XDECREF(__pyx_r);
12971  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12972  __Pyx_GOTREF(__pyx_t_3);
12973  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12974  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12975  __pyx_t_4 = __pyx_t_6;
12976  __pyx_v_suboffset = (__pyx_t_4[0]);
12977  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12978  __Pyx_GOTREF(__pyx_t_2);
12979  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12980  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12981  }
12982  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12983  __Pyx_GOTREF(__pyx_t_2);
12984  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12985  __pyx_r = __pyx_t_2;
12986  __pyx_t_2 = 0;
12987  goto __pyx_L0;
12988 
12989  /* "View.MemoryView":577
12990  *
12991  * @property
12992  * def suboffsets(self): # <<<<<<<<<<<<<<
12993  * if self.view.suboffsets == NULL:
12994  * return (-1,) * self.view.ndim
12995  */
12996 
12997  /* function exit code */
12998  __pyx_L1_error:;
12999  __Pyx_XDECREF(__pyx_t_2);
13000  __Pyx_XDECREF(__pyx_t_3);
13001  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13002  __pyx_r = NULL;
13003  __pyx_L0:;
13004  __Pyx_XGIVEREF(__pyx_r);
13005  __Pyx_TraceReturn(__pyx_r, 0);
13006  __Pyx_RefNannyFinishContext();
13007  return __pyx_r;
13008 }
13009 
13010 /* "View.MemoryView":584
13011  *
13012  * @property
13013  * def ndim(self): # <<<<<<<<<<<<<<
13014  * return self.view.ndim
13015  *
13016  */
13017 
13018 /* Python wrapper */
13019 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13020 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13021  PyObject *__pyx_r = 0;
13022  __Pyx_RefNannyDeclarations
13023  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13024  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13025 
13026  /* function exit code */
13027  __Pyx_RefNannyFinishContext();
13028  return __pyx_r;
13029 }
13030 
13031 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13032  PyObject *__pyx_r = NULL;
13033  __Pyx_TraceDeclarations
13034  __Pyx_RefNannyDeclarations
13035  PyObject *__pyx_t_1 = NULL;
13036  int __pyx_lineno = 0;
13037  const char *__pyx_filename = NULL;
13038  int __pyx_clineno = 0;
13039  __Pyx_RefNannySetupContext("__get__", 0);
13040  __Pyx_TraceCall("__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
13041 
13042  /* "View.MemoryView":585
13043  * @property
13044  * def ndim(self):
13045  * return self.view.ndim # <<<<<<<<<<<<<<
13046  *
13047  * @property
13048  */
13049  __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
13050  __Pyx_XDECREF(__pyx_r);
13051  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
13052  __Pyx_GOTREF(__pyx_t_1);
13053  __pyx_r = __pyx_t_1;
13054  __pyx_t_1 = 0;
13055  goto __pyx_L0;
13056 
13057  /* "View.MemoryView":584
13058  *
13059  * @property
13060  * def ndim(self): # <<<<<<<<<<<<<<
13061  * return self.view.ndim
13062  *
13063  */
13064 
13065  /* function exit code */
13066  __pyx_L1_error:;
13067  __Pyx_XDECREF(__pyx_t_1);
13068  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13069  __pyx_r = NULL;
13070  __pyx_L0:;
13071  __Pyx_XGIVEREF(__pyx_r);
13072  __Pyx_TraceReturn(__pyx_r, 0);
13073  __Pyx_RefNannyFinishContext();
13074  return __pyx_r;
13075 }
13076 
13077 /* "View.MemoryView":588
13078  *
13079  * @property
13080  * def itemsize(self): # <<<<<<<<<<<<<<
13081  * return self.view.itemsize
13082  *
13083  */
13084 
13085 /* Python wrapper */
13086 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13087 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13088  PyObject *__pyx_r = 0;
13089  __Pyx_RefNannyDeclarations
13090  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13091  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13092 
13093  /* function exit code */
13094  __Pyx_RefNannyFinishContext();
13095  return __pyx_r;
13096 }
13097 
13098 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13099  PyObject *__pyx_r = NULL;
13100  __Pyx_TraceDeclarations
13101  __Pyx_RefNannyDeclarations
13102  PyObject *__pyx_t_1 = NULL;
13103  int __pyx_lineno = 0;
13104  const char *__pyx_filename = NULL;
13105  int __pyx_clineno = 0;
13106  __Pyx_RefNannySetupContext("__get__", 0);
13107  __Pyx_TraceCall("__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
13108 
13109  /* "View.MemoryView":589
13110  * @property
13111  * def itemsize(self):
13112  * return self.view.itemsize # <<<<<<<<<<<<<<
13113  *
13114  * @property
13115  */
13116  __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
13117  __Pyx_XDECREF(__pyx_r);
13118  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
13119  __Pyx_GOTREF(__pyx_t_1);
13120  __pyx_r = __pyx_t_1;
13121  __pyx_t_1 = 0;
13122  goto __pyx_L0;
13123 
13124  /* "View.MemoryView":588
13125  *
13126  * @property
13127  * def itemsize(self): # <<<<<<<<<<<<<<
13128  * return self.view.itemsize
13129  *
13130  */
13131 
13132  /* function exit code */
13133  __pyx_L1_error:;
13134  __Pyx_XDECREF(__pyx_t_1);
13135  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13136  __pyx_r = NULL;
13137  __pyx_L0:;
13138  __Pyx_XGIVEREF(__pyx_r);
13139  __Pyx_TraceReturn(__pyx_r, 0);
13140  __Pyx_RefNannyFinishContext();
13141  return __pyx_r;
13142 }
13143 
13144 /* "View.MemoryView":592
13145  *
13146  * @property
13147  * def nbytes(self): # <<<<<<<<<<<<<<
13148  * return self.size * self.view.itemsize
13149  *
13150  */
13151 
13152 /* Python wrapper */
13153 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13154 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13155  PyObject *__pyx_r = 0;
13156  __Pyx_RefNannyDeclarations
13157  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13158  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13159 
13160  /* function exit code */
13161  __Pyx_RefNannyFinishContext();
13162  return __pyx_r;
13163 }
13164 
13165 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13166  PyObject *__pyx_r = NULL;
13167  __Pyx_TraceDeclarations
13168  __Pyx_RefNannyDeclarations
13169  PyObject *__pyx_t_1 = NULL;
13170  PyObject *__pyx_t_2 = NULL;
13171  PyObject *__pyx_t_3 = NULL;
13172  int __pyx_lineno = 0;
13173  const char *__pyx_filename = NULL;
13174  int __pyx_clineno = 0;
13175  __Pyx_RefNannySetupContext("__get__", 0);
13176  __Pyx_TraceCall("__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
13177 
13178  /* "View.MemoryView":593
13179  * @property
13180  * def nbytes(self):
13181  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13182  *
13183  * @property
13184  */
13185  __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
13186  __Pyx_XDECREF(__pyx_r);
13187  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
13188  __Pyx_GOTREF(__pyx_t_1);
13189  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
13190  __Pyx_GOTREF(__pyx_t_2);
13191  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
13192  __Pyx_GOTREF(__pyx_t_3);
13193  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13194  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13195  __pyx_r = __pyx_t_3;
13196  __pyx_t_3 = 0;
13197  goto __pyx_L0;
13198 
13199  /* "View.MemoryView":592
13200  *
13201  * @property
13202  * def nbytes(self): # <<<<<<<<<<<<<<
13203  * return self.size * self.view.itemsize
13204  *
13205  */
13206 
13207  /* function exit code */
13208  __pyx_L1_error:;
13209  __Pyx_XDECREF(__pyx_t_1);
13210  __Pyx_XDECREF(__pyx_t_2);
13211  __Pyx_XDECREF(__pyx_t_3);
13212  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13213  __pyx_r = NULL;
13214  __pyx_L0:;
13215  __Pyx_XGIVEREF(__pyx_r);
13216  __Pyx_TraceReturn(__pyx_r, 0);
13217  __Pyx_RefNannyFinishContext();
13218  return __pyx_r;
13219 }
13220 
13221 /* "View.MemoryView":596
13222  *
13223  * @property
13224  * def size(self): # <<<<<<<<<<<<<<
13225  * if self._size is None:
13226  * result = 1
13227  */
13228 
13229 /* Python wrapper */
13230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13231 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13232  PyObject *__pyx_r = 0;
13233  __Pyx_RefNannyDeclarations
13234  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13235  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13236 
13237  /* function exit code */
13238  __Pyx_RefNannyFinishContext();
13239  return __pyx_r;
13240 }
13241 
13242 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13243  PyObject *__pyx_v_result = NULL;
13244  PyObject *__pyx_v_length = NULL;
13245  PyObject *__pyx_r = NULL;
13246  __Pyx_TraceDeclarations
13247  __Pyx_RefNannyDeclarations
13248  int __pyx_t_1;
13249  int __pyx_t_2;
13250  Py_ssize_t *__pyx_t_3;
13251  Py_ssize_t *__pyx_t_4;
13252  Py_ssize_t *__pyx_t_5;
13253  PyObject *__pyx_t_6 = NULL;
13254  int __pyx_lineno = 0;
13255  const char *__pyx_filename = NULL;
13256  int __pyx_clineno = 0;
13257  __Pyx_RefNannySetupContext("__get__", 0);
13258  __Pyx_TraceCall("__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
13259 
13260  /* "View.MemoryView":597
13261  * @property
13262  * def size(self):
13263  * if self._size is None: # <<<<<<<<<<<<<<
13264  * result = 1
13265  *
13266  */
13267  __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
13268  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13269  __pyx_t_2 = (__pyx_t_1 != 0);
13270  if (__pyx_t_2) {
13271 
13272  /* "View.MemoryView":598
13273  * def size(self):
13274  * if self._size is None:
13275  * result = 1 # <<<<<<<<<<<<<<
13276  *
13277  * for length in self.view.shape[:self.view.ndim]:
13278  */
13279  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
13280  __Pyx_INCREF(__pyx_int_1);
13281  __pyx_v_result = __pyx_int_1;
13282 
13283  /* "View.MemoryView":600
13284  * result = 1
13285  *
13286  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13287  * result *= length
13288  *
13289  */
13290  __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
13291  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13292  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13293  __pyx_t_3 = __pyx_t_5;
13294  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
13295  __Pyx_GOTREF(__pyx_t_6);
13296  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13297  __pyx_t_6 = 0;
13298 
13299  /* "View.MemoryView":601
13300  *
13301  * for length in self.view.shape[:self.view.ndim]:
13302  * result *= length # <<<<<<<<<<<<<<
13303  *
13304  * self._size = result
13305  */
13306  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
13307  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
13308  __Pyx_GOTREF(__pyx_t_6);
13309  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13310  __pyx_t_6 = 0;
13311  }
13312 
13313  /* "View.MemoryView":603
13314  * result *= length
13315  *
13316  * self._size = result # <<<<<<<<<<<<<<
13317  *
13318  * return self._size
13319  */
13320  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13321  __Pyx_INCREF(__pyx_v_result);
13322  __Pyx_GIVEREF(__pyx_v_result);
13323  __Pyx_GOTREF(__pyx_v_self->_size);
13324  __Pyx_DECREF(__pyx_v_self->_size);
13325  __pyx_v_self->_size = __pyx_v_result;
13326 
13327  /* "View.MemoryView":597
13328  * @property
13329  * def size(self):
13330  * if self._size is None: # <<<<<<<<<<<<<<
13331  * result = 1
13332  *
13333  */
13334  }
13335 
13336  /* "View.MemoryView":605
13337  * self._size = result
13338  *
13339  * return self._size # <<<<<<<<<<<<<<
13340  *
13341  * def __len__(self):
13342  */
13343  __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
13344  __Pyx_XDECREF(__pyx_r);
13345  __Pyx_INCREF(__pyx_v_self->_size);
13346  __pyx_r = __pyx_v_self->_size;
13347  goto __pyx_L0;
13348 
13349  /* "View.MemoryView":596
13350  *
13351  * @property
13352  * def size(self): # <<<<<<<<<<<<<<
13353  * if self._size is None:
13354  * result = 1
13355  */
13356 
13357  /* function exit code */
13358  __pyx_L1_error:;
13359  __Pyx_XDECREF(__pyx_t_6);
13360  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13361  __pyx_r = NULL;
13362  __pyx_L0:;
13363  __Pyx_XDECREF(__pyx_v_result);
13364  __Pyx_XDECREF(__pyx_v_length);
13365  __Pyx_XGIVEREF(__pyx_r);
13366  __Pyx_TraceReturn(__pyx_r, 0);
13367  __Pyx_RefNannyFinishContext();
13368  return __pyx_r;
13369 }
13370 
13371 /* "View.MemoryView":607
13372  * return self._size
13373  *
13374  * def __len__(self): # <<<<<<<<<<<<<<
13375  * if self.view.ndim >= 1:
13376  * return self.view.shape[0]
13377  */
13378 
13379 /* Python wrapper */
13380 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13381 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13382  Py_ssize_t __pyx_r;
13383  __Pyx_RefNannyDeclarations
13384  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13385  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13386 
13387  /* function exit code */
13388  __Pyx_RefNannyFinishContext();
13389  return __pyx_r;
13390 }
13391 
13392 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13393  Py_ssize_t __pyx_r;
13394  __Pyx_TraceDeclarations
13395  __Pyx_RefNannyDeclarations
13396  int __pyx_t_1;
13397  int __pyx_lineno = 0;
13398  const char *__pyx_filename = NULL;
13399  int __pyx_clineno = 0;
13400  __Pyx_RefNannySetupContext("__len__", 0);
13401  __Pyx_TraceCall("__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
13402 
13403  /* "View.MemoryView":608
13404  *
13405  * def __len__(self):
13406  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13407  * return self.view.shape[0]
13408  *
13409  */
13410  __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
13411  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13412  if (__pyx_t_1) {
13413 
13414  /* "View.MemoryView":609
13415  * def __len__(self):
13416  * if self.view.ndim >= 1:
13417  * return self.view.shape[0] # <<<<<<<<<<<<<<
13418  *
13419  * return 0
13420  */
13421  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13422  __pyx_r = (__pyx_v_self->view.shape[0]);
13423  goto __pyx_L0;
13424 
13425  /* "View.MemoryView":608
13426  *
13427  * def __len__(self):
13428  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13429  * return self.view.shape[0]
13430  *
13431  */
13432  }
13433 
13434  /* "View.MemoryView":611
13435  * return self.view.shape[0]
13436  *
13437  * return 0 # <<<<<<<<<<<<<<
13438  *
13439  * def __repr__(self):
13440  */
13441  __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
13442  __pyx_r = 0;
13443  goto __pyx_L0;
13444 
13445  /* "View.MemoryView":607
13446  * return self._size
13447  *
13448  * def __len__(self): # <<<<<<<<<<<<<<
13449  * if self.view.ndim >= 1:
13450  * return self.view.shape[0]
13451  */
13452 
13453  /* function exit code */
13454  __pyx_L1_error:;
13455  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13456  __pyx_r = -1;
13457  __pyx_L0:;
13458  __Pyx_TraceReturn(Py_None, 0);
13459  __Pyx_RefNannyFinishContext();
13460  return __pyx_r;
13461 }
13462 
13463 /* "View.MemoryView":613
13464  * return 0
13465  *
13466  * def __repr__(self): # <<<<<<<<<<<<<<
13467  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13468  * id(self))
13469  */
13470 
13471 /* Python wrapper */
13472 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13473 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13474  PyObject *__pyx_r = 0;
13475  __Pyx_RefNannyDeclarations
13476  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13477  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13478 
13479  /* function exit code */
13480  __Pyx_RefNannyFinishContext();
13481  return __pyx_r;
13482 }
13483 
13484 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13485  PyObject *__pyx_r = NULL;
13486  __Pyx_TraceDeclarations
13487  __Pyx_RefNannyDeclarations
13488  PyObject *__pyx_t_1 = NULL;
13489  PyObject *__pyx_t_2 = NULL;
13490  PyObject *__pyx_t_3 = NULL;
13491  int __pyx_lineno = 0;
13492  const char *__pyx_filename = NULL;
13493  int __pyx_clineno = 0;
13494  __Pyx_RefNannySetupContext("__repr__", 0);
13495  __Pyx_TraceCall("__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
13496 
13497  /* "View.MemoryView":614
13498  *
13499  * def __repr__(self):
13500  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13501  * id(self))
13502  *
13503  */
13504  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13505  __Pyx_XDECREF(__pyx_r);
13506  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13507  __Pyx_GOTREF(__pyx_t_1);
13508  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13509  __Pyx_GOTREF(__pyx_t_2);
13510  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13511  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13512  __Pyx_GOTREF(__pyx_t_1);
13513  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13514 
13515  /* "View.MemoryView":615
13516  * def __repr__(self):
13517  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13518  * id(self)) # <<<<<<<<<<<<<<
13519  *
13520  * def __str__(self):
13521  */
13522  __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
13523  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
13524  __Pyx_GOTREF(__pyx_t_2);
13525 
13526  /* "View.MemoryView":614
13527  *
13528  * def __repr__(self):
13529  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13530  * id(self))
13531  *
13532  */
13533  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13534  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
13535  __Pyx_GOTREF(__pyx_t_3);
13536  __Pyx_GIVEREF(__pyx_t_1);
13537  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13538  __Pyx_GIVEREF(__pyx_t_2);
13539  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13540  __pyx_t_1 = 0;
13541  __pyx_t_2 = 0;
13542  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13543  __Pyx_GOTREF(__pyx_t_2);
13544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13545  __pyx_r = __pyx_t_2;
13546  __pyx_t_2 = 0;
13547  goto __pyx_L0;
13548 
13549  /* "View.MemoryView":613
13550  * return 0
13551  *
13552  * def __repr__(self): # <<<<<<<<<<<<<<
13553  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13554  * id(self))
13555  */
13556 
13557  /* function exit code */
13558  __pyx_L1_error:;
13559  __Pyx_XDECREF(__pyx_t_1);
13560  __Pyx_XDECREF(__pyx_t_2);
13561  __Pyx_XDECREF(__pyx_t_3);
13562  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13563  __pyx_r = NULL;
13564  __pyx_L0:;
13565  __Pyx_XGIVEREF(__pyx_r);
13566  __Pyx_TraceReturn(__pyx_r, 0);
13567  __Pyx_RefNannyFinishContext();
13568  return __pyx_r;
13569 }
13570 
13571 /* "View.MemoryView":617
13572  * id(self))
13573  *
13574  * def __str__(self): # <<<<<<<<<<<<<<
13575  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13576  *
13577  */
13578 
13579 /* Python wrapper */
13580 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13581 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13582  PyObject *__pyx_r = 0;
13583  __Pyx_RefNannyDeclarations
13584  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13585  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13586 
13587  /* function exit code */
13588  __Pyx_RefNannyFinishContext();
13589  return __pyx_r;
13590 }
13591 
13592 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13593  PyObject *__pyx_r = NULL;
13594  __Pyx_TraceDeclarations
13595  __Pyx_RefNannyDeclarations
13596  PyObject *__pyx_t_1 = NULL;
13597  PyObject *__pyx_t_2 = NULL;
13598  int __pyx_lineno = 0;
13599  const char *__pyx_filename = NULL;
13600  int __pyx_clineno = 0;
13601  __Pyx_RefNannySetupContext("__str__", 0);
13602  __Pyx_TraceCall("__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
13603 
13604  /* "View.MemoryView":618
13605  *
13606  * def __str__(self):
13607  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13608  *
13609  *
13610  */
13611  __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
13612  __Pyx_XDECREF(__pyx_r);
13613  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13614  __Pyx_GOTREF(__pyx_t_1);
13615  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13616  __Pyx_GOTREF(__pyx_t_2);
13617  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13618  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13619  __Pyx_GOTREF(__pyx_t_1);
13620  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13621  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13622  __Pyx_GOTREF(__pyx_t_2);
13623  __Pyx_GIVEREF(__pyx_t_1);
13624  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13625  __pyx_t_1 = 0;
13626  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13627  __Pyx_GOTREF(__pyx_t_1);
13628  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13629  __pyx_r = __pyx_t_1;
13630  __pyx_t_1 = 0;
13631  goto __pyx_L0;
13632 
13633  /* "View.MemoryView":617
13634  * id(self))
13635  *
13636  * def __str__(self): # <<<<<<<<<<<<<<
13637  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13638  *
13639  */
13640 
13641  /* function exit code */
13642  __pyx_L1_error:;
13643  __Pyx_XDECREF(__pyx_t_1);
13644  __Pyx_XDECREF(__pyx_t_2);
13645  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13646  __pyx_r = NULL;
13647  __pyx_L0:;
13648  __Pyx_XGIVEREF(__pyx_r);
13649  __Pyx_TraceReturn(__pyx_r, 0);
13650  __Pyx_RefNannyFinishContext();
13651  return __pyx_r;
13652 }
13653 
13654 /* "View.MemoryView":621
13655  *
13656  *
13657  * def is_c_contig(self): # <<<<<<<<<<<<<<
13658  * cdef __Pyx_memviewslice *mslice
13659  * cdef __Pyx_memviewslice tmp
13660  */
13661 
13662 /* Python wrapper */
13663 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13664 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13665 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13666  PyObject *__pyx_r = 0;
13667  __Pyx_RefNannyDeclarations
13668  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13669  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13670 
13671  /* function exit code */
13672  __Pyx_RefNannyFinishContext();
13673  return __pyx_r;
13674 }
13675 
13676 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13677  __Pyx_memviewslice *__pyx_v_mslice;
13678  __Pyx_memviewslice __pyx_v_tmp;
13679  PyObject *__pyx_r = NULL;
13680  __Pyx_TraceDeclarations
13681  __Pyx_RefNannyDeclarations
13682  __Pyx_memviewslice *__pyx_t_1;
13683  PyObject *__pyx_t_2 = NULL;
13684  int __pyx_lineno = 0;
13685  const char *__pyx_filename = NULL;
13686  int __pyx_clineno = 0;
13687  __Pyx_RefNannySetupContext("is_c_contig", 0);
13688  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
13689 
13690  /* "View.MemoryView":624
13691  * cdef __Pyx_memviewslice *mslice
13692  * cdef __Pyx_memviewslice tmp
13693  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13694  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13695  *
13696  */
13697  __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
13698  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
13699  __pyx_v_mslice = __pyx_t_1;
13700 
13701  /* "View.MemoryView":625
13702  * cdef __Pyx_memviewslice tmp
13703  * mslice = get_slice_from_memview(self, &tmp)
13704  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13705  *
13706  * def is_f_contig(self):
13707  */
13708  __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
13709  __Pyx_XDECREF(__pyx_r);
13710  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
13711  __Pyx_GOTREF(__pyx_t_2);
13712  __pyx_r = __pyx_t_2;
13713  __pyx_t_2 = 0;
13714  goto __pyx_L0;
13715 
13716  /* "View.MemoryView":621
13717  *
13718  *
13719  * def is_c_contig(self): # <<<<<<<<<<<<<<
13720  * cdef __Pyx_memviewslice *mslice
13721  * cdef __Pyx_memviewslice tmp
13722  */
13723 
13724  /* function exit code */
13725  __pyx_L1_error:;
13726  __Pyx_XDECREF(__pyx_t_2);
13727  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13728  __pyx_r = NULL;
13729  __pyx_L0:;
13730  __Pyx_XGIVEREF(__pyx_r);
13731  __Pyx_TraceReturn(__pyx_r, 0);
13732  __Pyx_RefNannyFinishContext();
13733  return __pyx_r;
13734 }
13735 
13736 /* "View.MemoryView":627
13737  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13738  *
13739  * def is_f_contig(self): # <<<<<<<<<<<<<<
13740  * cdef __Pyx_memviewslice *mslice
13741  * cdef __Pyx_memviewslice tmp
13742  */
13743 
13744 /* Python wrapper */
13745 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13746 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13747 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13748  PyObject *__pyx_r = 0;
13749  __Pyx_RefNannyDeclarations
13750  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13751  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13752 
13753  /* function exit code */
13754  __Pyx_RefNannyFinishContext();
13755  return __pyx_r;
13756 }
13757 
13758 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13759  __Pyx_memviewslice *__pyx_v_mslice;
13760  __Pyx_memviewslice __pyx_v_tmp;
13761  PyObject *__pyx_r = NULL;
13762  __Pyx_TraceDeclarations
13763  __Pyx_RefNannyDeclarations
13764  __Pyx_memviewslice *__pyx_t_1;
13765  PyObject *__pyx_t_2 = NULL;
13766  int __pyx_lineno = 0;
13767  const char *__pyx_filename = NULL;
13768  int __pyx_clineno = 0;
13769  __Pyx_RefNannySetupContext("is_f_contig", 0);
13770  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
13771 
13772  /* "View.MemoryView":630
13773  * cdef __Pyx_memviewslice *mslice
13774  * cdef __Pyx_memviewslice tmp
13775  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13776  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13777  *
13778  */
13779  __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
13780  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13781  __pyx_v_mslice = __pyx_t_1;
13782 
13783  /* "View.MemoryView":631
13784  * cdef __Pyx_memviewslice tmp
13785  * mslice = get_slice_from_memview(self, &tmp)
13786  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13787  *
13788  * def copy(self):
13789  */
13790  __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13791  __Pyx_XDECREF(__pyx_r);
13792  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13793  __Pyx_GOTREF(__pyx_t_2);
13794  __pyx_r = __pyx_t_2;
13795  __pyx_t_2 = 0;
13796  goto __pyx_L0;
13797 
13798  /* "View.MemoryView":627
13799  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13800  *
13801  * def is_f_contig(self): # <<<<<<<<<<<<<<
13802  * cdef __Pyx_memviewslice *mslice
13803  * cdef __Pyx_memviewslice tmp
13804  */
13805 
13806  /* function exit code */
13807  __pyx_L1_error:;
13808  __Pyx_XDECREF(__pyx_t_2);
13809  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13810  __pyx_r = NULL;
13811  __pyx_L0:;
13812  __Pyx_XGIVEREF(__pyx_r);
13813  __Pyx_TraceReturn(__pyx_r, 0);
13814  __Pyx_RefNannyFinishContext();
13815  return __pyx_r;
13816 }
13817 
13818 /* "View.MemoryView":633
13819  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13820  *
13821  * def copy(self): # <<<<<<<<<<<<<<
13822  * cdef __Pyx_memviewslice mslice
13823  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13824  */
13825 
13826 /* Python wrapper */
13827 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13828 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13829 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13830  PyObject *__pyx_r = 0;
13831  __Pyx_RefNannyDeclarations
13832  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13833  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13834 
13835  /* function exit code */
13836  __Pyx_RefNannyFinishContext();
13837  return __pyx_r;
13838 }
13839 
13840 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13841  __Pyx_memviewslice __pyx_v_mslice;
13842  int __pyx_v_flags;
13843  PyObject *__pyx_r = NULL;
13844  __Pyx_TraceDeclarations
13845  __Pyx_RefNannyDeclarations
13846  __Pyx_memviewslice __pyx_t_1;
13847  PyObject *__pyx_t_2 = NULL;
13848  int __pyx_lineno = 0;
13849  const char *__pyx_filename = NULL;
13850  int __pyx_clineno = 0;
13851  __Pyx_RefNannySetupContext("copy", 0);
13852  __Pyx_TraceCall("copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13853 
13854  /* "View.MemoryView":635
13855  * def copy(self):
13856  * cdef __Pyx_memviewslice mslice
13857  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13858  *
13859  * slice_copy(self, &mslice)
13860  */
13861  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13862  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13863 
13864  /* "View.MemoryView":637
13865  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13866  *
13867  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13868  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13869  * self.view.itemsize,
13870  */
13871  __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13872  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13873 
13874  /* "View.MemoryView":638
13875  *
13876  * slice_copy(self, &mslice)
13877  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13878  * self.view.itemsize,
13879  * flags|PyBUF_C_CONTIGUOUS,
13880  */
13881  __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13882  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13883  __pyx_v_mslice = __pyx_t_1;
13884 
13885  /* "View.MemoryView":643
13886  * self.dtype_is_object)
13887  *
13888  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13889  *
13890  * def copy_fortran(self):
13891  */
13892  __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13893  __Pyx_XDECREF(__pyx_r);
13894  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13895  __Pyx_GOTREF(__pyx_t_2);
13896  __pyx_r = __pyx_t_2;
13897  __pyx_t_2 = 0;
13898  goto __pyx_L0;
13899 
13900  /* "View.MemoryView":633
13901  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13902  *
13903  * def copy(self): # <<<<<<<<<<<<<<
13904  * cdef __Pyx_memviewslice mslice
13905  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13906  */
13907 
13908  /* function exit code */
13909  __pyx_L1_error:;
13910  __Pyx_XDECREF(__pyx_t_2);
13911  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13912  __pyx_r = NULL;
13913  __pyx_L0:;
13914  __Pyx_XGIVEREF(__pyx_r);
13915  __Pyx_TraceReturn(__pyx_r, 0);
13916  __Pyx_RefNannyFinishContext();
13917  return __pyx_r;
13918 }
13919 
13920 /* "View.MemoryView":645
13921  * return memoryview_copy_from_slice(self, &mslice)
13922  *
13923  * def copy_fortran(self): # <<<<<<<<<<<<<<
13924  * cdef __Pyx_memviewslice src, dst
13925  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13926  */
13927 
13928 /* Python wrapper */
13929 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13930 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13931 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13932  PyObject *__pyx_r = 0;
13933  __Pyx_RefNannyDeclarations
13934  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13935  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13936 
13937  /* function exit code */
13938  __Pyx_RefNannyFinishContext();
13939  return __pyx_r;
13940 }
13941 
13942 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13943  __Pyx_memviewslice __pyx_v_src;
13944  __Pyx_memviewslice __pyx_v_dst;
13945  int __pyx_v_flags;
13946  PyObject *__pyx_r = NULL;
13947  __Pyx_TraceDeclarations
13948  __Pyx_RefNannyDeclarations
13949  __Pyx_memviewslice __pyx_t_1;
13950  PyObject *__pyx_t_2 = NULL;
13951  int __pyx_lineno = 0;
13952  const char *__pyx_filename = NULL;
13953  int __pyx_clineno = 0;
13954  __Pyx_RefNannySetupContext("copy_fortran", 0);
13955  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13956 
13957  /* "View.MemoryView":647
13958  * def copy_fortran(self):
13959  * cdef __Pyx_memviewslice src, dst
13960  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13961  *
13962  * slice_copy(self, &src)
13963  */
13964  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13965  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13966 
13967  /* "View.MemoryView":649
13968  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13969  *
13970  * slice_copy(self, &src) # <<<<<<<<<<<<<<
13971  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13972  * self.view.itemsize,
13973  */
13974  __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13975  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13976 
13977  /* "View.MemoryView":650
13978  *
13979  * slice_copy(self, &src)
13980  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13981  * self.view.itemsize,
13982  * flags|PyBUF_F_CONTIGUOUS,
13983  */
13984  __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13985  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13986  __pyx_v_dst = __pyx_t_1;
13987 
13988  /* "View.MemoryView":655
13989  * self.dtype_is_object)
13990  *
13991  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13992  *
13993  *
13994  */
13995  __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13996  __Pyx_XDECREF(__pyx_r);
13997  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13998  __Pyx_GOTREF(__pyx_t_2);
13999  __pyx_r = __pyx_t_2;
14000  __pyx_t_2 = 0;
14001  goto __pyx_L0;
14002 
14003  /* "View.MemoryView":645
14004  * return memoryview_copy_from_slice(self, &mslice)
14005  *
14006  * def copy_fortran(self): # <<<<<<<<<<<<<<
14007  * cdef __Pyx_memviewslice src, dst
14008  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14009  */
14010 
14011  /* function exit code */
14012  __pyx_L1_error:;
14013  __Pyx_XDECREF(__pyx_t_2);
14014  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14015  __pyx_r = NULL;
14016  __pyx_L0:;
14017  __Pyx_XGIVEREF(__pyx_r);
14018  __Pyx_TraceReturn(__pyx_r, 0);
14019  __Pyx_RefNannyFinishContext();
14020  return __pyx_r;
14021 }
14022 
14023 /* "(tree fragment)":1
14024  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14025  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14026  * def __setstate_cython__(self, __pyx_state):
14027  */
14028 
14029 /* Python wrapper */
14030 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14031 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14032 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14033  PyObject *__pyx_r = 0;
14034  __Pyx_RefNannyDeclarations
14035  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14036  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14037 
14038  /* function exit code */
14039  __Pyx_RefNannyFinishContext();
14040  return __pyx_r;
14041 }
14042 
14043 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14044  PyObject *__pyx_r = NULL;
14045  __Pyx_TraceDeclarations
14046  __Pyx_RefNannyDeclarations
14047  PyObject *__pyx_t_1 = NULL;
14048  int __pyx_lineno = 0;
14049  const char *__pyx_filename = NULL;
14050  int __pyx_clineno = 0;
14051  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14052  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14053 
14054  /* "(tree fragment)":2
14055  * def __reduce_cython__(self):
14056  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14057  * def __setstate_cython__(self, __pyx_state):
14058  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14059  */
14060  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
14061  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14062  __Pyx_GOTREF(__pyx_t_1);
14063  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14064  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14065  __PYX_ERR(1, 2, __pyx_L1_error)
14066 
14067  /* "(tree fragment)":1
14068  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14069  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14070  * def __setstate_cython__(self, __pyx_state):
14071  */
14072 
14073  /* function exit code */
14074  __pyx_L1_error:;
14075  __Pyx_XDECREF(__pyx_t_1);
14076  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14077  __pyx_r = NULL;
14078  __Pyx_XGIVEREF(__pyx_r);
14079  __Pyx_TraceReturn(__pyx_r, 0);
14080  __Pyx_RefNannyFinishContext();
14081  return __pyx_r;
14082 }
14083 
14084 /* "(tree fragment)":3
14085  * def __reduce_cython__(self):
14086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14087  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14088  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14089  */
14090 
14091 /* Python wrapper */
14092 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14093 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14094 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14095  PyObject *__pyx_r = 0;
14096  __Pyx_RefNannyDeclarations
14097  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14098  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14099 
14100  /* function exit code */
14101  __Pyx_RefNannyFinishContext();
14102  return __pyx_r;
14103 }
14104 
14105 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14106  PyObject *__pyx_r = NULL;
14107  __Pyx_TraceDeclarations
14108  __Pyx_RefNannyDeclarations
14109  PyObject *__pyx_t_1 = NULL;
14110  int __pyx_lineno = 0;
14111  const char *__pyx_filename = NULL;
14112  int __pyx_clineno = 0;
14113  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14114  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14115 
14116  /* "(tree fragment)":4
14117  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14118  * def __setstate_cython__(self, __pyx_state):
14119  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14120  */
14121  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
14122  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14123  __Pyx_GOTREF(__pyx_t_1);
14124  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14125  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14126  __PYX_ERR(1, 4, __pyx_L1_error)
14127 
14128  /* "(tree fragment)":3
14129  * def __reduce_cython__(self):
14130  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14131  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14132  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14133  */
14134 
14135  /* function exit code */
14136  __pyx_L1_error:;
14137  __Pyx_XDECREF(__pyx_t_1);
14138  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14139  __pyx_r = NULL;
14140  __Pyx_XGIVEREF(__pyx_r);
14141  __Pyx_TraceReturn(__pyx_r, 0);
14142  __Pyx_RefNannyFinishContext();
14143  return __pyx_r;
14144 }
14145 
14146 /* "View.MemoryView":659
14147  *
14148  * @cname('__pyx_memoryview_new')
14149  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14150  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14151  * result.typeinfo = typeinfo
14152  */
14153 
14154 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14155  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14156  PyObject *__pyx_r = NULL;
14157  __Pyx_TraceDeclarations
14158  __Pyx_RefNannyDeclarations
14159  PyObject *__pyx_t_1 = NULL;
14160  PyObject *__pyx_t_2 = NULL;
14161  PyObject *__pyx_t_3 = NULL;
14162  int __pyx_lineno = 0;
14163  const char *__pyx_filename = NULL;
14164  int __pyx_clineno = 0;
14165  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14166  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
14167 
14168  /* "View.MemoryView":660
14169  * @cname('__pyx_memoryview_new')
14170  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14171  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14172  * result.typeinfo = typeinfo
14173  * return result
14174  */
14175  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
14176  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
14177  __Pyx_GOTREF(__pyx_t_1);
14178  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14179  __Pyx_GOTREF(__pyx_t_2);
14180  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
14181  __Pyx_GOTREF(__pyx_t_3);
14182  __Pyx_INCREF(__pyx_v_o);
14183  __Pyx_GIVEREF(__pyx_v_o);
14184  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14185  __Pyx_GIVEREF(__pyx_t_1);
14186  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14187  __Pyx_GIVEREF(__pyx_t_2);
14188  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14189  __pyx_t_1 = 0;
14190  __pyx_t_2 = 0;
14191  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14192  __Pyx_GOTREF(__pyx_t_2);
14193  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14194  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14195  __pyx_t_2 = 0;
14196 
14197  /* "View.MemoryView":661
14198  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14199  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14200  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14201  * return result
14202  *
14203  */
14204  __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
14205  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14206 
14207  /* "View.MemoryView":662
14208  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14209  * result.typeinfo = typeinfo
14210  * return result # <<<<<<<<<<<<<<
14211  *
14212  * @cname('__pyx_memoryview_check')
14213  */
14214  __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
14215  __Pyx_XDECREF(__pyx_r);
14216  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14217  __pyx_r = ((PyObject *)__pyx_v_result);
14218  goto __pyx_L0;
14219 
14220  /* "View.MemoryView":659
14221  *
14222  * @cname('__pyx_memoryview_new')
14223  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14224  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14225  * result.typeinfo = typeinfo
14226  */
14227 
14228  /* function exit code */
14229  __pyx_L1_error:;
14230  __Pyx_XDECREF(__pyx_t_1);
14231  __Pyx_XDECREF(__pyx_t_2);
14232  __Pyx_XDECREF(__pyx_t_3);
14233  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14234  __pyx_r = 0;
14235  __pyx_L0:;
14236  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14237  __Pyx_XGIVEREF(__pyx_r);
14238  __Pyx_TraceReturn(__pyx_r, 0);
14239  __Pyx_RefNannyFinishContext();
14240  return __pyx_r;
14241 }
14242 
14243 /* "View.MemoryView":665
14244  *
14245  * @cname('__pyx_memoryview_check')
14246  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14247  * return isinstance(o, memoryview)
14248  *
14249  */
14250 
14251 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14252  int __pyx_r;
14253  __Pyx_TraceDeclarations
14254  __Pyx_RefNannyDeclarations
14255  int __pyx_t_1;
14256  int __pyx_lineno = 0;
14257  const char *__pyx_filename = NULL;
14258  int __pyx_clineno = 0;
14259  __Pyx_RefNannySetupContext("memoryview_check", 0);
14260  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
14261 
14262  /* "View.MemoryView":666
14263  * @cname('__pyx_memoryview_check')
14264  * cdef inline bint memoryview_check(object o):
14265  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14266  *
14267  * cdef tuple _unellipsify(object index, int ndim):
14268  */
14269  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
14270  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14271  __pyx_r = __pyx_t_1;
14272  goto __pyx_L0;
14273 
14274  /* "View.MemoryView":665
14275  *
14276  * @cname('__pyx_memoryview_check')
14277  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14278  * return isinstance(o, memoryview)
14279  *
14280  */
14281 
14282  /* function exit code */
14283  __pyx_L1_error:;
14284  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14285  __pyx_r = 0;
14286  __pyx_L0:;
14287  __Pyx_TraceReturn(Py_None, 0);
14288  __Pyx_RefNannyFinishContext();
14289  return __pyx_r;
14290 }
14291 
14292 /* "View.MemoryView":668
14293  * return isinstance(o, memoryview)
14294  *
14295  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14296  * """
14297  * Replace all ellipses with full slices and fill incomplete indices with
14298  */
14299 
14300 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14301  PyObject *__pyx_v_tup = NULL;
14302  PyObject *__pyx_v_result = NULL;
14303  int __pyx_v_have_slices;
14304  int __pyx_v_seen_ellipsis;
14305  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14306  PyObject *__pyx_v_item = NULL;
14307  Py_ssize_t __pyx_v_nslices;
14308  PyObject *__pyx_r = NULL;
14309  __Pyx_TraceDeclarations
14310  __Pyx_RefNannyDeclarations
14311  int __pyx_t_1;
14312  int __pyx_t_2;
14313  PyObject *__pyx_t_3 = NULL;
14314  PyObject *__pyx_t_4 = NULL;
14315  Py_ssize_t __pyx_t_5;
14316  PyObject *(*__pyx_t_6)(PyObject *);
14317  PyObject *__pyx_t_7 = NULL;
14318  Py_ssize_t __pyx_t_8;
14319  int __pyx_t_9;
14320  int __pyx_t_10;
14321  PyObject *__pyx_t_11 = NULL;
14322  int __pyx_lineno = 0;
14323  const char *__pyx_filename = NULL;
14324  int __pyx_clineno = 0;
14325  __Pyx_RefNannySetupContext("_unellipsify", 0);
14326  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
14327 
14328  /* "View.MemoryView":673
14329  * full slices.
14330  * """
14331  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14332  * tup = (index,)
14333  * else:
14334  */
14335  __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
14336  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14337  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14338  if (__pyx_t_2) {
14339 
14340  /* "View.MemoryView":674
14341  * """
14342  * if not isinstance(index, tuple):
14343  * tup = (index,) # <<<<<<<<<<<<<<
14344  * else:
14345  * tup = index
14346  */
14347  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14348  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
14349  __Pyx_GOTREF(__pyx_t_3);
14350  __Pyx_INCREF(__pyx_v_index);
14351  __Pyx_GIVEREF(__pyx_v_index);
14352  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14353  __pyx_v_tup = __pyx_t_3;
14354  __pyx_t_3 = 0;
14355 
14356  /* "View.MemoryView":673
14357  * full slices.
14358  * """
14359  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14360  * tup = (index,)
14361  * else:
14362  */
14363  goto __pyx_L3;
14364  }
14365 
14366  /* "View.MemoryView":676
14367  * tup = (index,)
14368  * else:
14369  * tup = index # <<<<<<<<<<<<<<
14370  *
14371  * result = []
14372  */
14373  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14374  /*else*/ {
14375  __Pyx_INCREF(__pyx_v_index);
14376  __pyx_v_tup = __pyx_v_index;
14377  }
14378  __pyx_L3:;
14379 
14380  /* "View.MemoryView":678
14381  * tup = index
14382  *
14383  * result = [] # <<<<<<<<<<<<<<
14384  * have_slices = False
14385  * seen_ellipsis = False
14386  */
14387  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14388  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
14389  __Pyx_GOTREF(__pyx_t_3);
14390  __pyx_v_result = ((PyObject*)__pyx_t_3);
14391  __pyx_t_3 = 0;
14392 
14393  /* "View.MemoryView":679
14394  *
14395  * result = []
14396  * have_slices = False # <<<<<<<<<<<<<<
14397  * seen_ellipsis = False
14398  * for idx, item in enumerate(tup):
14399  */
14400  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14401  __pyx_v_have_slices = 0;
14402 
14403  /* "View.MemoryView":680
14404  * result = []
14405  * have_slices = False
14406  * seen_ellipsis = False # <<<<<<<<<<<<<<
14407  * for idx, item in enumerate(tup):
14408  * if item is Ellipsis:
14409  */
14410  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14411  __pyx_v_seen_ellipsis = 0;
14412 
14413  /* "View.MemoryView":681
14414  * have_slices = False
14415  * seen_ellipsis = False
14416  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14417  * if item is Ellipsis:
14418  * if not seen_ellipsis:
14419  */
14420  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14421  __Pyx_INCREF(__pyx_int_0);
14422  __pyx_t_3 = __pyx_int_0;
14423  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14424  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14425  __pyx_t_6 = NULL;
14426  } else {
14427  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
14428  __Pyx_GOTREF(__pyx_t_4);
14429  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
14430  }
14431  for (;;) {
14432  if (likely(!__pyx_t_6)) {
14433  if (likely(PyList_CheckExact(__pyx_t_4))) {
14434  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14435  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14436  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14437  #else
14438  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14439  __Pyx_GOTREF(__pyx_t_7);
14440  #endif
14441  } else {
14442  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14443  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14444  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14445  #else
14446  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14447  __Pyx_GOTREF(__pyx_t_7);
14448  #endif
14449  }
14450  } else {
14451  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14452  if (unlikely(!__pyx_t_7)) {
14453  PyObject* exc_type = PyErr_Occurred();
14454  if (exc_type) {
14455  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14456  else __PYX_ERR(1, 681, __pyx_L1_error)
14457  }
14458  break;
14459  }
14460  __Pyx_GOTREF(__pyx_t_7);
14461  }
14462  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14463  __pyx_t_7 = 0;
14464  __Pyx_INCREF(__pyx_t_3);
14465  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14466  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14467  __Pyx_GOTREF(__pyx_t_7);
14468  __Pyx_DECREF(__pyx_t_3);
14469  __pyx_t_3 = __pyx_t_7;
14470  __pyx_t_7 = 0;
14471 
14472  /* "View.MemoryView":682
14473  * seen_ellipsis = False
14474  * for idx, item in enumerate(tup):
14475  * if item is Ellipsis: # <<<<<<<<<<<<<<
14476  * if not seen_ellipsis:
14477  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14478  */
14479  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14480  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14481  __pyx_t_1 = (__pyx_t_2 != 0);
14482  if (__pyx_t_1) {
14483 
14484  /* "View.MemoryView":683
14485  * for idx, item in enumerate(tup):
14486  * if item is Ellipsis:
14487  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14488  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14489  * seen_ellipsis = True
14490  */
14491  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14492  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14493  if (__pyx_t_1) {
14494 
14495  /* "View.MemoryView":684
14496  * if item is Ellipsis:
14497  * if not seen_ellipsis:
14498  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14499  * seen_ellipsis = True
14500  * else:
14501  */
14502  __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
14503  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14504  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14505  __Pyx_GOTREF(__pyx_t_7);
14506  { Py_ssize_t __pyx_temp;
14507  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14508  __Pyx_INCREF(__pyx_slice__32);
14509  __Pyx_GIVEREF(__pyx_slice__32);
14510  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14511  }
14512  }
14513  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14514  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14515 
14516  /* "View.MemoryView":685
14517  * if not seen_ellipsis:
14518  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14519  * seen_ellipsis = True # <<<<<<<<<<<<<<
14520  * else:
14521  * result.append(slice(None))
14522  */
14523  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14524  __pyx_v_seen_ellipsis = 1;
14525 
14526  /* "View.MemoryView":683
14527  * for idx, item in enumerate(tup):
14528  * if item is Ellipsis:
14529  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14530  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14531  * seen_ellipsis = True
14532  */
14533  goto __pyx_L7;
14534  }
14535 
14536  /* "View.MemoryView":687
14537  * seen_ellipsis = True
14538  * else:
14539  * result.append(slice(None)) # <<<<<<<<<<<<<<
14540  * have_slices = True
14541  * else:
14542  */
14543  __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
14544  /*else*/ {
14545  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
14546  }
14547  __pyx_L7:;
14548 
14549  /* "View.MemoryView":688
14550  * else:
14551  * result.append(slice(None))
14552  * have_slices = True # <<<<<<<<<<<<<<
14553  * else:
14554  * if not isinstance(item, slice) and not PyIndex_Check(item):
14555  */
14556  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14557  __pyx_v_have_slices = 1;
14558 
14559  /* "View.MemoryView":682
14560  * seen_ellipsis = False
14561  * for idx, item in enumerate(tup):
14562  * if item is Ellipsis: # <<<<<<<<<<<<<<
14563  * if not seen_ellipsis:
14564  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14565  */
14566  goto __pyx_L6;
14567  }
14568 
14569  /* "View.MemoryView":690
14570  * have_slices = True
14571  * else:
14572  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14573  * raise TypeError("Cannot index with type '%s'" % type(item))
14574  *
14575  */
14576  __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
14577  /*else*/ {
14578  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14579  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14580  if (__pyx_t_10) {
14581  } else {
14582  __pyx_t_1 = __pyx_t_10;
14583  goto __pyx_L9_bool_binop_done;
14584  }
14585  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14586  __pyx_t_1 = __pyx_t_10;
14587  __pyx_L9_bool_binop_done:;
14588  if (unlikely(__pyx_t_1)) {
14589 
14590  /* "View.MemoryView":691
14591  * else:
14592  * if not isinstance(item, slice) and not PyIndex_Check(item):
14593  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14594  *
14595  * have_slices = have_slices or isinstance(item, slice)
14596  */
14597  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14598  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
14599  __Pyx_GOTREF(__pyx_t_7);
14600  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
14601  __Pyx_GOTREF(__pyx_t_11);
14602  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14603  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14604  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14605  __PYX_ERR(1, 691, __pyx_L1_error)
14606 
14607  /* "View.MemoryView":690
14608  * have_slices = True
14609  * else:
14610  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14611  * raise TypeError("Cannot index with type '%s'" % type(item))
14612  *
14613  */
14614  }
14615 
14616  /* "View.MemoryView":693
14617  * raise TypeError("Cannot index with type '%s'" % type(item))
14618  *
14619  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14620  * result.append(item)
14621  *
14622  */
14623  __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
14624  __pyx_t_10 = (__pyx_v_have_slices != 0);
14625  if (!__pyx_t_10) {
14626  } else {
14627  __pyx_t_1 = __pyx_t_10;
14628  goto __pyx_L11_bool_binop_done;
14629  }
14630  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14631  __pyx_t_2 = (__pyx_t_10 != 0);
14632  __pyx_t_1 = __pyx_t_2;
14633  __pyx_L11_bool_binop_done:;
14634  __pyx_v_have_slices = __pyx_t_1;
14635 
14636  /* "View.MemoryView":694
14637  *
14638  * have_slices = have_slices or isinstance(item, slice)
14639  * result.append(item) # <<<<<<<<<<<<<<
14640  *
14641  * nslices = ndim - len(result)
14642  */
14643  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14644  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14645  }
14646  __pyx_L6:;
14647 
14648  /* "View.MemoryView":681
14649  * have_slices = False
14650  * seen_ellipsis = False
14651  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14652  * if item is Ellipsis:
14653  * if not seen_ellipsis:
14654  */
14655  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14656  }
14657  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14658  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14659 
14660  /* "View.MemoryView":696
14661  * result.append(item)
14662  *
14663  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14664  * if nslices:
14665  * result.extend([slice(None)] * nslices)
14666  */
14667  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14668  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14669  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14670 
14671  /* "View.MemoryView":697
14672  *
14673  * nslices = ndim - len(result)
14674  * if nslices: # <<<<<<<<<<<<<<
14675  * result.extend([slice(None)] * nslices)
14676  *
14677  */
14678  __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
14679  __pyx_t_1 = (__pyx_v_nslices != 0);
14680  if (__pyx_t_1) {
14681 
14682  /* "View.MemoryView":698
14683  * nslices = ndim - len(result)
14684  * if nslices:
14685  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14686  *
14687  * return have_slices or nslices, tuple(result)
14688  */
14689  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14690  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
14691  __Pyx_GOTREF(__pyx_t_3);
14692  { Py_ssize_t __pyx_temp;
14693  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14694  __Pyx_INCREF(__pyx_slice__32);
14695  __Pyx_GIVEREF(__pyx_slice__32);
14696  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14697  }
14698  }
14699  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
14700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14701 
14702  /* "View.MemoryView":697
14703  *
14704  * nslices = ndim - len(result)
14705  * if nslices: # <<<<<<<<<<<<<<
14706  * result.extend([slice(None)] * nslices)
14707  *
14708  */
14709  }
14710 
14711  /* "View.MemoryView":700
14712  * result.extend([slice(None)] * nslices)
14713  *
14714  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14715  *
14716  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14717  */
14718  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
14719  __Pyx_XDECREF(__pyx_r);
14720  if (!__pyx_v_have_slices) {
14721  } else {
14722  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14723  __Pyx_GOTREF(__pyx_t_4);
14724  __pyx_t_3 = __pyx_t_4;
14725  __pyx_t_4 = 0;
14726  goto __pyx_L14_bool_binop_done;
14727  }
14728  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14729  __Pyx_GOTREF(__pyx_t_4);
14730  __pyx_t_3 = __pyx_t_4;
14731  __pyx_t_4 = 0;
14732  __pyx_L14_bool_binop_done:;
14733  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14734  __Pyx_GOTREF(__pyx_t_4);
14735  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
14736  __Pyx_GOTREF(__pyx_t_11);
14737  __Pyx_GIVEREF(__pyx_t_3);
14738  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14739  __Pyx_GIVEREF(__pyx_t_4);
14740  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14741  __pyx_t_3 = 0;
14742  __pyx_t_4 = 0;
14743  __pyx_r = ((PyObject*)__pyx_t_11);
14744  __pyx_t_11 = 0;
14745  goto __pyx_L0;
14746 
14747  /* "View.MemoryView":668
14748  * return isinstance(o, memoryview)
14749  *
14750  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14751  * """
14752  * Replace all ellipses with full slices and fill incomplete indices with
14753  */
14754 
14755  /* function exit code */
14756  __pyx_L1_error:;
14757  __Pyx_XDECREF(__pyx_t_3);
14758  __Pyx_XDECREF(__pyx_t_4);
14759  __Pyx_XDECREF(__pyx_t_7);
14760  __Pyx_XDECREF(__pyx_t_11);
14761  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14762  __pyx_r = 0;
14763  __pyx_L0:;
14764  __Pyx_XDECREF(__pyx_v_tup);
14765  __Pyx_XDECREF(__pyx_v_result);
14766  __Pyx_XDECREF(__pyx_v_idx);
14767  __Pyx_XDECREF(__pyx_v_item);
14768  __Pyx_XGIVEREF(__pyx_r);
14769  __Pyx_TraceReturn(__pyx_r, 0);
14770  __Pyx_RefNannyFinishContext();
14771  return __pyx_r;
14772 }
14773 
14774 /* "View.MemoryView":702
14775  * return have_slices or nslices, tuple(result)
14776  *
14777  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14778  * for suboffset in suboffsets[:ndim]:
14779  * if suboffset >= 0:
14780  */
14781 
14782 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14783  Py_ssize_t __pyx_v_suboffset;
14784  PyObject *__pyx_r = NULL;
14785  __Pyx_TraceDeclarations
14786  __Pyx_RefNannyDeclarations
14787  Py_ssize_t *__pyx_t_1;
14788  Py_ssize_t *__pyx_t_2;
14789  Py_ssize_t *__pyx_t_3;
14790  int __pyx_t_4;
14791  PyObject *__pyx_t_5 = NULL;
14792  int __pyx_lineno = 0;
14793  const char *__pyx_filename = NULL;
14794  int __pyx_clineno = 0;
14795  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14796  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14797 
14798  /* "View.MemoryView":703
14799  *
14800  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14801  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14802  * if suboffset >= 0:
14803  * raise ValueError("Indirect dimensions not supported")
14804  */
14805  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14806  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14807  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14808  __pyx_t_1 = __pyx_t_3;
14809  __pyx_v_suboffset = (__pyx_t_1[0]);
14810 
14811  /* "View.MemoryView":704
14812  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14813  * for suboffset in suboffsets[:ndim]:
14814  * if suboffset >= 0: # <<<<<<<<<<<<<<
14815  * raise ValueError("Indirect dimensions not supported")
14816  *
14817  */
14818  __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14819  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14820  if (unlikely(__pyx_t_4)) {
14821 
14822  /* "View.MemoryView":705
14823  * for suboffset in suboffsets[:ndim]:
14824  * if suboffset >= 0:
14825  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14826  *
14827  *
14828  */
14829  __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14830  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14831  __Pyx_GOTREF(__pyx_t_5);
14832  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14833  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14834  __PYX_ERR(1, 705, __pyx_L1_error)
14835 
14836  /* "View.MemoryView":704
14837  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14838  * for suboffset in suboffsets[:ndim]:
14839  * if suboffset >= 0: # <<<<<<<<<<<<<<
14840  * raise ValueError("Indirect dimensions not supported")
14841  *
14842  */
14843  }
14844  }
14845 
14846  /* "View.MemoryView":702
14847  * return have_slices or nslices, tuple(result)
14848  *
14849  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14850  * for suboffset in suboffsets[:ndim]:
14851  * if suboffset >= 0:
14852  */
14853 
14854  /* function exit code */
14855  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14856  goto __pyx_L0;
14857  __pyx_L1_error:;
14858  __Pyx_XDECREF(__pyx_t_5);
14859  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14860  __pyx_r = 0;
14861  __pyx_L0:;
14862  __Pyx_XGIVEREF(__pyx_r);
14863  __Pyx_TraceReturn(__pyx_r, 0);
14864  __Pyx_RefNannyFinishContext();
14865  return __pyx_r;
14866 }
14867 
14868 /* "View.MemoryView":712
14869  *
14870  * @cname('__pyx_memview_slice')
14871  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14872  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14873  * cdef bint negative_step
14874  */
14875 
14876 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14877  int __pyx_v_new_ndim;
14878  int __pyx_v_suboffset_dim;
14879  int __pyx_v_dim;
14880  __Pyx_memviewslice __pyx_v_src;
14881  __Pyx_memviewslice __pyx_v_dst;
14882  __Pyx_memviewslice *__pyx_v_p_src;
14883  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14884  __Pyx_memviewslice *__pyx_v_p_dst;
14885  int *__pyx_v_p_suboffset_dim;
14886  Py_ssize_t __pyx_v_start;
14887  Py_ssize_t __pyx_v_stop;
14888  Py_ssize_t __pyx_v_step;
14889  int __pyx_v_have_start;
14890  int __pyx_v_have_stop;
14891  int __pyx_v_have_step;
14892  PyObject *__pyx_v_index = NULL;
14893  struct __pyx_memoryview_obj *__pyx_r = NULL;
14894  __Pyx_TraceDeclarations
14895  __Pyx_RefNannyDeclarations
14896  int __pyx_t_1;
14897  int __pyx_t_2;
14898  PyObject *__pyx_t_3 = NULL;
14899  struct __pyx_memoryview_obj *__pyx_t_4;
14900  char *__pyx_t_5;
14901  int __pyx_t_6;
14902  Py_ssize_t __pyx_t_7;
14903  PyObject *(*__pyx_t_8)(PyObject *);
14904  PyObject *__pyx_t_9 = NULL;
14905  Py_ssize_t __pyx_t_10;
14906  int __pyx_t_11;
14907  Py_ssize_t __pyx_t_12;
14908  int __pyx_lineno = 0;
14909  const char *__pyx_filename = NULL;
14910  int __pyx_clineno = 0;
14911  __Pyx_RefNannySetupContext("memview_slice", 0);
14912  __Pyx_TraceCall("memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14913 
14914  /* "View.MemoryView":713
14915  * @cname('__pyx_memview_slice')
14916  * cdef memoryview memview_slice(memoryview memview, object indices):
14917  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14918  * cdef bint negative_step
14919  * cdef __Pyx_memviewslice src, dst
14920  */
14921  __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14922  __pyx_v_new_ndim = 0;
14923  __pyx_v_suboffset_dim = -1;
14924 
14925  /* "View.MemoryView":720
14926  *
14927  *
14928  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14929  *
14930  * cdef _memoryviewslice memviewsliceobj
14931  */
14932  __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14933  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14934 
14935  /* "View.MemoryView":724
14936  * cdef _memoryviewslice memviewsliceobj
14937  *
14938  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14939  *
14940  * if isinstance(memview, _memoryviewslice):
14941  */
14942  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14943  #ifndef CYTHON_WITHOUT_ASSERTIONS
14944  if (unlikely(__pyx_assertions_enabled())) {
14945  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14946  PyErr_SetNone(PyExc_AssertionError);
14947  __PYX_ERR(1, 724, __pyx_L1_error)
14948  }
14949  }
14950  #endif
14951 
14952  /* "View.MemoryView":726
14953  * assert memview.view.ndim > 0
14954  *
14955  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14956  * memviewsliceobj = memview
14957  * p_src = &memviewsliceobj.from_slice
14958  */
14959  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14960  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14961  __pyx_t_2 = (__pyx_t_1 != 0);
14962  if (__pyx_t_2) {
14963 
14964  /* "View.MemoryView":727
14965  *
14966  * if isinstance(memview, _memoryviewslice):
14967  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14968  * p_src = &memviewsliceobj.from_slice
14969  * else:
14970  */
14971  __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14972  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14973  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14974  __Pyx_INCREF(__pyx_t_3);
14975  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14976  __pyx_t_3 = 0;
14977 
14978  /* "View.MemoryView":728
14979  * if isinstance(memview, _memoryviewslice):
14980  * memviewsliceobj = memview
14981  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14982  * else:
14983  * slice_copy(memview, &src)
14984  */
14985  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14986  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14987 
14988  /* "View.MemoryView":726
14989  * assert memview.view.ndim > 0
14990  *
14991  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14992  * memviewsliceobj = memview
14993  * p_src = &memviewsliceobj.from_slice
14994  */
14995  goto __pyx_L3;
14996  }
14997 
14998  /* "View.MemoryView":730
14999  * p_src = &memviewsliceobj.from_slice
15000  * else:
15001  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15002  * p_src = &src
15003  *
15004  */
15005  __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
15006  /*else*/ {
15007  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15008 
15009  /* "View.MemoryView":731
15010  * else:
15011  * slice_copy(memview, &src)
15012  * p_src = &src # <<<<<<<<<<<<<<
15013  *
15014  *
15015  */
15016  __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
15017  __pyx_v_p_src = (&__pyx_v_src);
15018  }
15019  __pyx_L3:;
15020 
15021  /* "View.MemoryView":737
15022  *
15023  *
15024  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15025  * dst.data = p_src.data
15026  *
15027  */
15028  __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
15029  __pyx_t_4 = __pyx_v_p_src->memview;
15030  __pyx_v_dst.memview = __pyx_t_4;
15031 
15032  /* "View.MemoryView":738
15033  *
15034  * dst.memview = p_src.memview
15035  * dst.data = p_src.data # <<<<<<<<<<<<<<
15036  *
15037  *
15038  */
15039  __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
15040  __pyx_t_5 = __pyx_v_p_src->data;
15041  __pyx_v_dst.data = __pyx_t_5;
15042 
15043  /* "View.MemoryView":743
15044  *
15045  *
15046  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15047  * cdef int *p_suboffset_dim = &suboffset_dim
15048  * cdef Py_ssize_t start, stop, step
15049  */
15050  __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
15051  __pyx_v_p_dst = (&__pyx_v_dst);
15052 
15053  /* "View.MemoryView":744
15054  *
15055  * cdef __Pyx_memviewslice *p_dst = &dst
15056  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15057  * cdef Py_ssize_t start, stop, step
15058  * cdef bint have_start, have_stop, have_step
15059  */
15060  __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
15061  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15062 
15063  /* "View.MemoryView":748
15064  * cdef bint have_start, have_stop, have_step
15065  *
15066  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15067  * if PyIndex_Check(index):
15068  * slice_memviewslice(
15069  */
15070  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15071  __pyx_t_6 = 0;
15072  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15073  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15074  __pyx_t_8 = NULL;
15075  } else {
15076  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
15077  __Pyx_GOTREF(__pyx_t_3);
15078  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
15079  }
15080  for (;;) {
15081  if (likely(!__pyx_t_8)) {
15082  if (likely(PyList_CheckExact(__pyx_t_3))) {
15083  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15084  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15085  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15086  #else
15087  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15088  __Pyx_GOTREF(__pyx_t_9);
15089  #endif
15090  } else {
15091  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15092  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15093  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15094  #else
15095  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15096  __Pyx_GOTREF(__pyx_t_9);
15097  #endif
15098  }
15099  } else {
15100  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15101  if (unlikely(!__pyx_t_9)) {
15102  PyObject* exc_type = PyErr_Occurred();
15103  if (exc_type) {
15104  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15105  else __PYX_ERR(1, 748, __pyx_L1_error)
15106  }
15107  break;
15108  }
15109  __Pyx_GOTREF(__pyx_t_9);
15110  }
15111  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15112  __pyx_t_9 = 0;
15113  __pyx_v_dim = __pyx_t_6;
15114  __pyx_t_6 = (__pyx_t_6 + 1);
15115 
15116  /* "View.MemoryView":749
15117  *
15118  * for dim, index in enumerate(indices):
15119  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15120  * slice_memviewslice(
15121  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15122  */
15123  __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
15124  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15125  if (__pyx_t_2) {
15126 
15127  /* "View.MemoryView":753
15128  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15129  * dim, new_ndim, p_suboffset_dim,
15130  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15131  * 0, 0, 0, # have_{start,stop,step}
15132  * False)
15133  */
15134  __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
15135  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
15136 
15137  /* "View.MemoryView":750
15138  * for dim, index in enumerate(indices):
15139  * if PyIndex_Check(index):
15140  * slice_memviewslice( # <<<<<<<<<<<<<<
15141  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15142  * dim, new_ndim, p_suboffset_dim,
15143  */
15144  __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
15145  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
15146 
15147  /* "View.MemoryView":749
15148  *
15149  * for dim, index in enumerate(indices):
15150  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15151  * slice_memviewslice(
15152  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15153  */
15154  goto __pyx_L6;
15155  }
15156 
15157  /* "View.MemoryView":756
15158  * 0, 0, 0, # have_{start,stop,step}
15159  * False)
15160  * elif index is None: # <<<<<<<<<<<<<<
15161  * p_dst.shape[new_ndim] = 1
15162  * p_dst.strides[new_ndim] = 0
15163  */
15164  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
15165  __pyx_t_2 = (__pyx_v_index == Py_None);
15166  __pyx_t_1 = (__pyx_t_2 != 0);
15167  if (__pyx_t_1) {
15168 
15169  /* "View.MemoryView":757
15170  * False)
15171  * elif index is None:
15172  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15173  * p_dst.strides[new_ndim] = 0
15174  * p_dst.suboffsets[new_ndim] = -1
15175  */
15176  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
15177  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15178 
15179  /* "View.MemoryView":758
15180  * elif index is None:
15181  * p_dst.shape[new_ndim] = 1
15182  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15183  * p_dst.suboffsets[new_ndim] = -1
15184  * new_ndim += 1
15185  */
15186  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
15187  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15188 
15189  /* "View.MemoryView":759
15190  * p_dst.shape[new_ndim] = 1
15191  * p_dst.strides[new_ndim] = 0
15192  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15193  * new_ndim += 1
15194  * else:
15195  */
15196  __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
15197  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15198 
15199  /* "View.MemoryView":760
15200  * p_dst.strides[new_ndim] = 0
15201  * p_dst.suboffsets[new_ndim] = -1
15202  * new_ndim += 1 # <<<<<<<<<<<<<<
15203  * else:
15204  * start = index.start or 0
15205  */
15206  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
15207  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15208 
15209  /* "View.MemoryView":756
15210  * 0, 0, 0, # have_{start,stop,step}
15211  * False)
15212  * elif index is None: # <<<<<<<<<<<<<<
15213  * p_dst.shape[new_ndim] = 1
15214  * p_dst.strides[new_ndim] = 0
15215  */
15216  goto __pyx_L6;
15217  }
15218 
15219  /* "View.MemoryView":762
15220  * new_ndim += 1
15221  * else:
15222  * start = index.start or 0 # <<<<<<<<<<<<<<
15223  * stop = index.stop or 0
15224  * step = index.step or 0
15225  */
15226  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
15227  /*else*/ {
15228  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15229  __Pyx_GOTREF(__pyx_t_9);
15230  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15231  if (!__pyx_t_1) {
15232  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15233  } else {
15234  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15235  __pyx_t_10 = __pyx_t_12;
15236  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15237  goto __pyx_L7_bool_binop_done;
15238  }
15239  __pyx_t_10 = 0;
15240  __pyx_L7_bool_binop_done:;
15241  __pyx_v_start = __pyx_t_10;
15242 
15243  /* "View.MemoryView":763
15244  * else:
15245  * start = index.start or 0
15246  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15247  * step = index.step or 0
15248  *
15249  */
15250  __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
15251  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
15252  __Pyx_GOTREF(__pyx_t_9);
15253  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
15254  if (!__pyx_t_1) {
15255  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15256  } else {
15257  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
15258  __pyx_t_10 = __pyx_t_12;
15259  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15260  goto __pyx_L9_bool_binop_done;
15261  }
15262  __pyx_t_10 = 0;
15263  __pyx_L9_bool_binop_done:;
15264  __pyx_v_stop = __pyx_t_10;
15265 
15266  /* "View.MemoryView":764
15267  * start = index.start or 0
15268  * stop = index.stop or 0
15269  * step = index.step or 0 # <<<<<<<<<<<<<<
15270  *
15271  * have_start = index.start is not None
15272  */
15273  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
15274  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15275  __Pyx_GOTREF(__pyx_t_9);
15276  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
15277  if (!__pyx_t_1) {
15278  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15279  } else {
15280  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
15281  __pyx_t_10 = __pyx_t_12;
15282  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15283  goto __pyx_L11_bool_binop_done;
15284  }
15285  __pyx_t_10 = 0;
15286  __pyx_L11_bool_binop_done:;
15287  __pyx_v_step = __pyx_t_10;
15288 
15289  /* "View.MemoryView":766
15290  * step = index.step or 0
15291  *
15292  * have_start = index.start is not None # <<<<<<<<<<<<<<
15293  * have_stop = index.stop is not None
15294  * have_step = index.step is not None
15295  */
15296  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
15297  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15298  __Pyx_GOTREF(__pyx_t_9);
15299  __pyx_t_1 = (__pyx_t_9 != Py_None);
15300  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15301  __pyx_v_have_start = __pyx_t_1;
15302 
15303  /* "View.MemoryView":767
15304  *
15305  * have_start = index.start is not None
15306  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15307  * have_step = index.step is not None
15308  *
15309  */
15310  __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
15311  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
15312  __Pyx_GOTREF(__pyx_t_9);
15313  __pyx_t_1 = (__pyx_t_9 != Py_None);
15314  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15315  __pyx_v_have_stop = __pyx_t_1;
15316 
15317  /* "View.MemoryView":768
15318  * have_start = index.start is not None
15319  * have_stop = index.stop is not None
15320  * have_step = index.step is not None # <<<<<<<<<<<<<<
15321  *
15322  * slice_memviewslice(
15323  */
15324  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15325  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
15326  __Pyx_GOTREF(__pyx_t_9);
15327  __pyx_t_1 = (__pyx_t_9 != Py_None);
15328  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15329  __pyx_v_have_step = __pyx_t_1;
15330 
15331  /* "View.MemoryView":770
15332  * have_step = index.step is not None
15333  *
15334  * slice_memviewslice( # <<<<<<<<<<<<<<
15335  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15336  * dim, new_ndim, p_suboffset_dim,
15337  */
15338  __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
15339  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
15340 
15341  /* "View.MemoryView":776
15342  * have_start, have_stop, have_step,
15343  * True)
15344  * new_ndim += 1 # <<<<<<<<<<<<<<
15345  *
15346  * if isinstance(memview, _memoryviewslice):
15347  */
15348  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15349  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15350  }
15351  __pyx_L6:;
15352 
15353  /* "View.MemoryView":748
15354  * cdef bint have_start, have_stop, have_step
15355  *
15356  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15357  * if PyIndex_Check(index):
15358  * slice_memviewslice(
15359  */
15360  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15361  }
15362  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15363 
15364  /* "View.MemoryView":778
15365  * new_ndim += 1
15366  *
15367  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15368  * return memoryview_fromslice(dst, new_ndim,
15369  * memviewsliceobj.to_object_func,
15370  */
15371  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15372  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15373  __pyx_t_2 = (__pyx_t_1 != 0);
15374  if (__pyx_t_2) {
15375 
15376  /* "View.MemoryView":779
15377  *
15378  * if isinstance(memview, _memoryviewslice):
15379  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15380  * memviewsliceobj.to_object_func,
15381  * memviewsliceobj.to_dtype_func,
15382  */
15383  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15384  __Pyx_XDECREF(((PyObject *)__pyx_r));
15385 
15386  /* "View.MemoryView":780
15387  * if isinstance(memview, _memoryviewslice):
15388  * return memoryview_fromslice(dst, new_ndim,
15389  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15390  * memviewsliceobj.to_dtype_func,
15391  * memview.dtype_is_object)
15392  */
15393  __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
15394  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
15395 
15396  /* "View.MemoryView":781
15397  * return memoryview_fromslice(dst, new_ndim,
15398  * memviewsliceobj.to_object_func,
15399  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15400  * memview.dtype_is_object)
15401  * else:
15402  */
15403  __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
15404  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
15405 
15406  /* "View.MemoryView":779
15407  *
15408  * if isinstance(memview, _memoryviewslice):
15409  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15410  * memviewsliceobj.to_object_func,
15411  * memviewsliceobj.to_dtype_func,
15412  */
15413  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15414  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
15415  __Pyx_GOTREF(__pyx_t_3);
15416  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
15417  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15418  __pyx_t_3 = 0;
15419  goto __pyx_L0;
15420 
15421  /* "View.MemoryView":778
15422  * new_ndim += 1
15423  *
15424  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15425  * return memoryview_fromslice(dst, new_ndim,
15426  * memviewsliceobj.to_object_func,
15427  */
15428  }
15429 
15430  /* "View.MemoryView":784
15431  * memview.dtype_is_object)
15432  * else:
15433  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15434  * memview.dtype_is_object)
15435  *
15436  */
15437  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15438  /*else*/ {
15439  __Pyx_XDECREF(((PyObject *)__pyx_r));
15440 
15441  /* "View.MemoryView":785
15442  * else:
15443  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15444  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15445  *
15446  *
15447  */
15448  __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
15449  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
15450  __Pyx_GOTREF(__pyx_t_3);
15451 
15452  /* "View.MemoryView":784
15453  * memview.dtype_is_object)
15454  * else:
15455  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15456  * memview.dtype_is_object)
15457  *
15458  */
15459  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15460  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
15461  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15462  __pyx_t_3 = 0;
15463  goto __pyx_L0;
15464  }
15465 
15466  /* "View.MemoryView":712
15467  *
15468  * @cname('__pyx_memview_slice')
15469  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15470  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15471  * cdef bint negative_step
15472  */
15473 
15474  /* function exit code */
15475  __pyx_L1_error:;
15476  __Pyx_XDECREF(__pyx_t_3);
15477  __Pyx_XDECREF(__pyx_t_9);
15478  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15479  __pyx_r = 0;
15480  __pyx_L0:;
15481  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15482  __Pyx_XDECREF(__pyx_v_index);
15483  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15484  __Pyx_TraceReturn(__pyx_r, 0);
15485  __Pyx_RefNannyFinishContext();
15486  return __pyx_r;
15487 }
15488 
15489 /* "View.MemoryView":809
15490  *
15491  * @cname('__pyx_memoryview_slice_memviewslice')
15492  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15493  * __Pyx_memviewslice *dst,
15494  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15495  */
15496 
15497 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15498  Py_ssize_t __pyx_v_new_shape;
15499  int __pyx_v_negative_step;
15500  int __pyx_r;
15501  __Pyx_TraceDeclarations
15502  int __pyx_t_1;
15503  int __pyx_t_2;
15504  int __pyx_t_3;
15505  int __pyx_lineno = 0;
15506  const char *__pyx_filename = NULL;
15507  int __pyx_clineno = 0;
15508  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
15509 
15510  /* "View.MemoryView":829
15511  * cdef bint negative_step
15512  *
15513  * if not is_slice: # <<<<<<<<<<<<<<
15514  *
15515  * if start < 0:
15516  */
15517  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15518  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15519  if (__pyx_t_1) {
15520 
15521  /* "View.MemoryView":831
15522  * if not is_slice:
15523  *
15524  * if start < 0: # <<<<<<<<<<<<<<
15525  * start += shape
15526  * if not 0 <= start < shape:
15527  */
15528  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15529  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15530  if (__pyx_t_1) {
15531 
15532  /* "View.MemoryView":832
15533  *
15534  * if start < 0:
15535  * start += shape # <<<<<<<<<<<<<<
15536  * if not 0 <= start < shape:
15537  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15538  */
15539  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15540  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15541 
15542  /* "View.MemoryView":831
15543  * if not is_slice:
15544  *
15545  * if start < 0: # <<<<<<<<<<<<<<
15546  * start += shape
15547  * if not 0 <= start < shape:
15548  */
15549  }
15550 
15551  /* "View.MemoryView":833
15552  * if start < 0:
15553  * start += shape
15554  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15555  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15556  * else:
15557  */
15558  __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
15559  __pyx_t_1 = (0 <= __pyx_v_start);
15560  if (__pyx_t_1) {
15561  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15562  }
15563  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15564  if (__pyx_t_2) {
15565 
15566  /* "View.MemoryView":834
15567  * start += shape
15568  * if not 0 <= start < shape:
15569  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15570  * else:
15571  *
15572  */
15573  __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
15574  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
15575 
15576  /* "View.MemoryView":833
15577  * if start < 0:
15578  * start += shape
15579  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15580  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15581  * else:
15582  */
15583  }
15584 
15585  /* "View.MemoryView":829
15586  * cdef bint negative_step
15587  *
15588  * if not is_slice: # <<<<<<<<<<<<<<
15589  *
15590  * if start < 0:
15591  */
15592  goto __pyx_L3;
15593  }
15594 
15595  /* "View.MemoryView":837
15596  * else:
15597  *
15598  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15599  *
15600  * if have_step and step == 0:
15601  */
15602  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15603  /*else*/ {
15604  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15605  if (__pyx_t_1) {
15606  } else {
15607  __pyx_t_2 = __pyx_t_1;
15608  goto __pyx_L6_bool_binop_done;
15609  }
15610  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15611  __pyx_t_2 = __pyx_t_1;
15612  __pyx_L6_bool_binop_done:;
15613  __pyx_v_negative_step = __pyx_t_2;
15614 
15615  /* "View.MemoryView":839
15616  * negative_step = have_step != 0 and step < 0
15617  *
15618  * if have_step and step == 0: # <<<<<<<<<<<<<<
15619  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15620  *
15621  */
15622  __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
15623  __pyx_t_1 = (__pyx_v_have_step != 0);
15624  if (__pyx_t_1) {
15625  } else {
15626  __pyx_t_2 = __pyx_t_1;
15627  goto __pyx_L9_bool_binop_done;
15628  }
15629  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15630  __pyx_t_2 = __pyx_t_1;
15631  __pyx_L9_bool_binop_done:;
15632  if (__pyx_t_2) {
15633 
15634  /* "View.MemoryView":840
15635  *
15636  * if have_step and step == 0:
15637  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15638  *
15639  *
15640  */
15641  __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
15642  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
15643 
15644  /* "View.MemoryView":839
15645  * negative_step = have_step != 0 and step < 0
15646  *
15647  * if have_step and step == 0: # <<<<<<<<<<<<<<
15648  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15649  *
15650  */
15651  }
15652 
15653  /* "View.MemoryView":843
15654  *
15655  *
15656  * if have_start: # <<<<<<<<<<<<<<
15657  * if start < 0:
15658  * start += shape
15659  */
15660  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15661  __pyx_t_2 = (__pyx_v_have_start != 0);
15662  if (__pyx_t_2) {
15663 
15664  /* "View.MemoryView":844
15665  *
15666  * if have_start:
15667  * if start < 0: # <<<<<<<<<<<<<<
15668  * start += shape
15669  * if start < 0:
15670  */
15671  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15672  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15673  if (__pyx_t_2) {
15674 
15675  /* "View.MemoryView":845
15676  * if have_start:
15677  * if start < 0:
15678  * start += shape # <<<<<<<<<<<<<<
15679  * if start < 0:
15680  * start = 0
15681  */
15682  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15683  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15684 
15685  /* "View.MemoryView":846
15686  * if start < 0:
15687  * start += shape
15688  * if start < 0: # <<<<<<<<<<<<<<
15689  * start = 0
15690  * elif start >= shape:
15691  */
15692  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15693  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15694  if (__pyx_t_2) {
15695 
15696  /* "View.MemoryView":847
15697  * start += shape
15698  * if start < 0:
15699  * start = 0 # <<<<<<<<<<<<<<
15700  * elif start >= shape:
15701  * if negative_step:
15702  */
15703  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15704  __pyx_v_start = 0;
15705 
15706  /* "View.MemoryView":846
15707  * if start < 0:
15708  * start += shape
15709  * if start < 0: # <<<<<<<<<<<<<<
15710  * start = 0
15711  * elif start >= shape:
15712  */
15713  }
15714 
15715  /* "View.MemoryView":844
15716  *
15717  * if have_start:
15718  * if start < 0: # <<<<<<<<<<<<<<
15719  * start += shape
15720  * if start < 0:
15721  */
15722  goto __pyx_L12;
15723  }
15724 
15725  /* "View.MemoryView":848
15726  * if start < 0:
15727  * start = 0
15728  * elif start >= shape: # <<<<<<<<<<<<<<
15729  * if negative_step:
15730  * start = shape - 1
15731  */
15732  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15733  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15734  if (__pyx_t_2) {
15735 
15736  /* "View.MemoryView":849
15737  * start = 0
15738  * elif start >= shape:
15739  * if negative_step: # <<<<<<<<<<<<<<
15740  * start = shape - 1
15741  * else:
15742  */
15743  __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
15744  __pyx_t_2 = (__pyx_v_negative_step != 0);
15745  if (__pyx_t_2) {
15746 
15747  /* "View.MemoryView":850
15748  * elif start >= shape:
15749  * if negative_step:
15750  * start = shape - 1 # <<<<<<<<<<<<<<
15751  * else:
15752  * start = shape
15753  */
15754  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15755  __pyx_v_start = (__pyx_v_shape - 1);
15756 
15757  /* "View.MemoryView":849
15758  * start = 0
15759  * elif start >= shape:
15760  * if negative_step: # <<<<<<<<<<<<<<
15761  * start = shape - 1
15762  * else:
15763  */
15764  goto __pyx_L14;
15765  }
15766 
15767  /* "View.MemoryView":852
15768  * start = shape - 1
15769  * else:
15770  * start = shape # <<<<<<<<<<<<<<
15771  * else:
15772  * if negative_step:
15773  */
15774  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15775  /*else*/ {
15776  __pyx_v_start = __pyx_v_shape;
15777  }
15778  __pyx_L14:;
15779 
15780  /* "View.MemoryView":848
15781  * if start < 0:
15782  * start = 0
15783  * elif start >= shape: # <<<<<<<<<<<<<<
15784  * if negative_step:
15785  * start = shape - 1
15786  */
15787  }
15788  __pyx_L12:;
15789 
15790  /* "View.MemoryView":843
15791  *
15792  *
15793  * if have_start: # <<<<<<<<<<<<<<
15794  * if start < 0:
15795  * start += shape
15796  */
15797  goto __pyx_L11;
15798  }
15799 
15800  /* "View.MemoryView":854
15801  * start = shape
15802  * else:
15803  * if negative_step: # <<<<<<<<<<<<<<
15804  * start = shape - 1
15805  * else:
15806  */
15807  __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15808  /*else*/ {
15809  __pyx_t_2 = (__pyx_v_negative_step != 0);
15810  if (__pyx_t_2) {
15811 
15812  /* "View.MemoryView":855
15813  * else:
15814  * if negative_step:
15815  * start = shape - 1 # <<<<<<<<<<<<<<
15816  * else:
15817  * start = 0
15818  */
15819  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15820  __pyx_v_start = (__pyx_v_shape - 1);
15821 
15822  /* "View.MemoryView":854
15823  * start = shape
15824  * else:
15825  * if negative_step: # <<<<<<<<<<<<<<
15826  * start = shape - 1
15827  * else:
15828  */
15829  goto __pyx_L15;
15830  }
15831 
15832  /* "View.MemoryView":857
15833  * start = shape - 1
15834  * else:
15835  * start = 0 # <<<<<<<<<<<<<<
15836  *
15837  * if have_stop:
15838  */
15839  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15840  /*else*/ {
15841  __pyx_v_start = 0;
15842  }
15843  __pyx_L15:;
15844  }
15845  __pyx_L11:;
15846 
15847  /* "View.MemoryView":859
15848  * start = 0
15849  *
15850  * if have_stop: # <<<<<<<<<<<<<<
15851  * if stop < 0:
15852  * stop += shape
15853  */
15854  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15855  __pyx_t_2 = (__pyx_v_have_stop != 0);
15856  if (__pyx_t_2) {
15857 
15858  /* "View.MemoryView":860
15859  *
15860  * if have_stop:
15861  * if stop < 0: # <<<<<<<<<<<<<<
15862  * stop += shape
15863  * if stop < 0:
15864  */
15865  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15866  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15867  if (__pyx_t_2) {
15868 
15869  /* "View.MemoryView":861
15870  * if have_stop:
15871  * if stop < 0:
15872  * stop += shape # <<<<<<<<<<<<<<
15873  * if stop < 0:
15874  * stop = 0
15875  */
15876  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15877  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15878 
15879  /* "View.MemoryView":862
15880  * if stop < 0:
15881  * stop += shape
15882  * if stop < 0: # <<<<<<<<<<<<<<
15883  * stop = 0
15884  * elif stop > shape:
15885  */
15886  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15887  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15888  if (__pyx_t_2) {
15889 
15890  /* "View.MemoryView":863
15891  * stop += shape
15892  * if stop < 0:
15893  * stop = 0 # <<<<<<<<<<<<<<
15894  * elif stop > shape:
15895  * stop = shape
15896  */
15897  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15898  __pyx_v_stop = 0;
15899 
15900  /* "View.MemoryView":862
15901  * if stop < 0:
15902  * stop += shape
15903  * if stop < 0: # <<<<<<<<<<<<<<
15904  * stop = 0
15905  * elif stop > shape:
15906  */
15907  }
15908 
15909  /* "View.MemoryView":860
15910  *
15911  * if have_stop:
15912  * if stop < 0: # <<<<<<<<<<<<<<
15913  * stop += shape
15914  * if stop < 0:
15915  */
15916  goto __pyx_L17;
15917  }
15918 
15919  /* "View.MemoryView":864
15920  * if stop < 0:
15921  * stop = 0
15922  * elif stop > shape: # <<<<<<<<<<<<<<
15923  * stop = shape
15924  * else:
15925  */
15926  __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15927  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15928  if (__pyx_t_2) {
15929 
15930  /* "View.MemoryView":865
15931  * stop = 0
15932  * elif stop > shape:
15933  * stop = shape # <<<<<<<<<<<<<<
15934  * else:
15935  * if negative_step:
15936  */
15937  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15938  __pyx_v_stop = __pyx_v_shape;
15939 
15940  /* "View.MemoryView":864
15941  * if stop < 0:
15942  * stop = 0
15943  * elif stop > shape: # <<<<<<<<<<<<<<
15944  * stop = shape
15945  * else:
15946  */
15947  }
15948  __pyx_L17:;
15949 
15950  /* "View.MemoryView":859
15951  * start = 0
15952  *
15953  * if have_stop: # <<<<<<<<<<<<<<
15954  * if stop < 0:
15955  * stop += shape
15956  */
15957  goto __pyx_L16;
15958  }
15959 
15960  /* "View.MemoryView":867
15961  * stop = shape
15962  * else:
15963  * if negative_step: # <<<<<<<<<<<<<<
15964  * stop = -1
15965  * else:
15966  */
15967  __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15968  /*else*/ {
15969  __pyx_t_2 = (__pyx_v_negative_step != 0);
15970  if (__pyx_t_2) {
15971 
15972  /* "View.MemoryView":868
15973  * else:
15974  * if negative_step:
15975  * stop = -1 # <<<<<<<<<<<<<<
15976  * else:
15977  * stop = shape
15978  */
15979  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15980  __pyx_v_stop = -1L;
15981 
15982  /* "View.MemoryView":867
15983  * stop = shape
15984  * else:
15985  * if negative_step: # <<<<<<<<<<<<<<
15986  * stop = -1
15987  * else:
15988  */
15989  goto __pyx_L19;
15990  }
15991 
15992  /* "View.MemoryView":870
15993  * stop = -1
15994  * else:
15995  * stop = shape # <<<<<<<<<<<<<<
15996  *
15997  * if not have_step:
15998  */
15999  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
16000  /*else*/ {
16001  __pyx_v_stop = __pyx_v_shape;
16002  }
16003  __pyx_L19:;
16004  }
16005  __pyx_L16:;
16006 
16007  /* "View.MemoryView":872
16008  * stop = shape
16009  *
16010  * if not have_step: # <<<<<<<<<<<<<<
16011  * step = 1
16012  *
16013  */
16014  __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
16015  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16016  if (__pyx_t_2) {
16017 
16018  /* "View.MemoryView":873
16019  *
16020  * if not have_step:
16021  * step = 1 # <<<<<<<<<<<<<<
16022  *
16023  *
16024  */
16025  __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
16026  __pyx_v_step = 1;
16027 
16028  /* "View.MemoryView":872
16029  * stop = shape
16030  *
16031  * if not have_step: # <<<<<<<<<<<<<<
16032  * step = 1
16033  *
16034  */
16035  }
16036 
16037  /* "View.MemoryView":877
16038  *
16039  * with cython.cdivision(True):
16040  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16041  *
16042  * if (stop - start) - step * new_shape:
16043  */
16044  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16045 
16046  /* "View.MemoryView":879
16047  * new_shape = (stop - start) // step
16048  *
16049  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16050  * new_shape += 1
16051  *
16052  */
16053  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16054  if (__pyx_t_2) {
16055 
16056  /* "View.MemoryView":880
16057  *
16058  * if (stop - start) - step * new_shape:
16059  * new_shape += 1 # <<<<<<<<<<<<<<
16060  *
16061  * if new_shape < 0:
16062  */
16063  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16064 
16065  /* "View.MemoryView":879
16066  * new_shape = (stop - start) // step
16067  *
16068  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16069  * new_shape += 1
16070  *
16071  */
16072  }
16073 
16074  /* "View.MemoryView":882
16075  * new_shape += 1
16076  *
16077  * if new_shape < 0: # <<<<<<<<<<<<<<
16078  * new_shape = 0
16079  *
16080  */
16081  __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
16082  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16083  if (__pyx_t_2) {
16084 
16085  /* "View.MemoryView":883
16086  *
16087  * if new_shape < 0:
16088  * new_shape = 0 # <<<<<<<<<<<<<<
16089  *
16090  *
16091  */
16092  __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
16093  __pyx_v_new_shape = 0;
16094 
16095  /* "View.MemoryView":882
16096  * new_shape += 1
16097  *
16098  * if new_shape < 0: # <<<<<<<<<<<<<<
16099  * new_shape = 0
16100  *
16101  */
16102  }
16103 
16104  /* "View.MemoryView":886
16105  *
16106  *
16107  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16108  * dst.shape[new_ndim] = new_shape
16109  * dst.suboffsets[new_ndim] = suboffset
16110  */
16111  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
16112  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16113 
16114  /* "View.MemoryView":887
16115  *
16116  * dst.strides[new_ndim] = stride * step
16117  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16118  * dst.suboffsets[new_ndim] = suboffset
16119  *
16120  */
16121  __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
16122  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16123 
16124  /* "View.MemoryView":888
16125  * dst.strides[new_ndim] = stride * step
16126  * dst.shape[new_ndim] = new_shape
16127  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16128  *
16129  *
16130  */
16131  __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
16132  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16133  }
16134  __pyx_L3:;
16135 
16136  /* "View.MemoryView":891
16137  *
16138  *
16139  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16140  * dst.data += start * stride
16141  * else:
16142  */
16143  __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
16144  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16145  if (__pyx_t_2) {
16146 
16147  /* "View.MemoryView":892
16148  *
16149  * if suboffset_dim[0] < 0:
16150  * dst.data += start * stride # <<<<<<<<<<<<<<
16151  * else:
16152  * dst.suboffsets[suboffset_dim[0]] += start * stride
16153  */
16154  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
16155  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16156 
16157  /* "View.MemoryView":891
16158  *
16159  *
16160  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16161  * dst.data += start * stride
16162  * else:
16163  */
16164  goto __pyx_L23;
16165  }
16166 
16167  /* "View.MemoryView":894
16168  * dst.data += start * stride
16169  * else:
16170  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16171  *
16172  * if suboffset >= 0:
16173  */
16174  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
16175  /*else*/ {
16176  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16177  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16178  }
16179  __pyx_L23:;
16180 
16181  /* "View.MemoryView":896
16182  * dst.suboffsets[suboffset_dim[0]] += start * stride
16183  *
16184  * if suboffset >= 0: # <<<<<<<<<<<<<<
16185  * if not is_slice:
16186  * if new_ndim == 0:
16187  */
16188  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
16189  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16190  if (__pyx_t_2) {
16191 
16192  /* "View.MemoryView":897
16193  *
16194  * if suboffset >= 0:
16195  * if not is_slice: # <<<<<<<<<<<<<<
16196  * if new_ndim == 0:
16197  * dst.data = (<char **> dst.data)[0] + suboffset
16198  */
16199  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
16200  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16201  if (__pyx_t_2) {
16202 
16203  /* "View.MemoryView":898
16204  * if suboffset >= 0:
16205  * if not is_slice:
16206  * if new_ndim == 0: # <<<<<<<<<<<<<<
16207  * dst.data = (<char **> dst.data)[0] + suboffset
16208  * else:
16209  */
16210  __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
16211  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16212  if (__pyx_t_2) {
16213 
16214  /* "View.MemoryView":899
16215  * if not is_slice:
16216  * if new_ndim == 0:
16217  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16218  * else:
16219  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16220  */
16221  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
16222  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16223 
16224  /* "View.MemoryView":898
16225  * if suboffset >= 0:
16226  * if not is_slice:
16227  * if new_ndim == 0: # <<<<<<<<<<<<<<
16228  * dst.data = (<char **> dst.data)[0] + suboffset
16229  * else:
16230  */
16231  goto __pyx_L26;
16232  }
16233 
16234  /* "View.MemoryView":901
16235  * dst.data = (<char **> dst.data)[0] + suboffset
16236  * else:
16237  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16238  * "must be indexed and not sliced", dim)
16239  * else:
16240  */
16241  __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
16242  /*else*/ {
16243 
16244  /* "View.MemoryView":902
16245  * else:
16246  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16247  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16248  * else:
16249  * suboffset_dim[0] = new_ndim
16250  */
16251  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
16252  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
16253  }
16254  __pyx_L26:;
16255 
16256  /* "View.MemoryView":897
16257  *
16258  * if suboffset >= 0:
16259  * if not is_slice: # <<<<<<<<<<<<<<
16260  * if new_ndim == 0:
16261  * dst.data = (<char **> dst.data)[0] + suboffset
16262  */
16263  goto __pyx_L25;
16264  }
16265 
16266  /* "View.MemoryView":904
16267  * "must be indexed and not sliced", dim)
16268  * else:
16269  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16270  *
16271  * return 0
16272  */
16273  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
16274  /*else*/ {
16275  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16276  }
16277  __pyx_L25:;
16278 
16279  /* "View.MemoryView":896
16280  * dst.suboffsets[suboffset_dim[0]] += start * stride
16281  *
16282  * if suboffset >= 0: # <<<<<<<<<<<<<<
16283  * if not is_slice:
16284  * if new_ndim == 0:
16285  */
16286  }
16287 
16288  /* "View.MemoryView":906
16289  * suboffset_dim[0] = new_ndim
16290  *
16291  * return 0 # <<<<<<<<<<<<<<
16292  *
16293  *
16294  */
16295  __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
16296  __pyx_r = 0;
16297  goto __pyx_L0;
16298 
16299  /* "View.MemoryView":809
16300  *
16301  * @cname('__pyx_memoryview_slice_memviewslice')
16302  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16303  * __Pyx_memviewslice *dst,
16304  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16305  */
16306 
16307  /* function exit code */
16308  __pyx_L1_error:;
16309  {
16310  #ifdef WITH_THREAD
16311  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16312  #endif
16313  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16314  #ifdef WITH_THREAD
16315  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16316  #endif
16317  }
16318  __pyx_r = -1;
16319  __pyx_L0:;
16320  __Pyx_TraceReturn(Py_None, 1);
16321  return __pyx_r;
16322 }
16323 
16324 /* "View.MemoryView":912
16325  *
16326  * @cname('__pyx_pybuffer_index')
16327  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16328  * Py_ssize_t dim) except NULL:
16329  * cdef Py_ssize_t shape, stride, suboffset = -1
16330  */
16331 
16332 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16333  Py_ssize_t __pyx_v_shape;
16334  Py_ssize_t __pyx_v_stride;
16335  Py_ssize_t __pyx_v_suboffset;
16336  Py_ssize_t __pyx_v_itemsize;
16337  char *__pyx_v_resultp;
16338  char *__pyx_r;
16339  __Pyx_TraceDeclarations
16340  __Pyx_RefNannyDeclarations
16341  Py_ssize_t __pyx_t_1;
16342  int __pyx_t_2;
16343  PyObject *__pyx_t_3 = NULL;
16344  PyObject *__pyx_t_4 = NULL;
16345  int __pyx_lineno = 0;
16346  const char *__pyx_filename = NULL;
16347  int __pyx_clineno = 0;
16348  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16349  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
16350 
16351  /* "View.MemoryView":914
16352  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16353  * Py_ssize_t dim) except NULL:
16354  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16355  * cdef Py_ssize_t itemsize = view.itemsize
16356  * cdef char *resultp
16357  */
16358  __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
16359  __pyx_v_suboffset = -1L;
16360 
16361  /* "View.MemoryView":915
16362  * Py_ssize_t dim) except NULL:
16363  * cdef Py_ssize_t shape, stride, suboffset = -1
16364  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16365  * cdef char *resultp
16366  *
16367  */
16368  __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
16369  __pyx_t_1 = __pyx_v_view->itemsize;
16370  __pyx_v_itemsize = __pyx_t_1;
16371 
16372  /* "View.MemoryView":918
16373  * cdef char *resultp
16374  *
16375  * if view.ndim == 0: # <<<<<<<<<<<<<<
16376  * shape = view.len / itemsize
16377  * stride = itemsize
16378  */
16379  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16380  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16381  if (__pyx_t_2) {
16382 
16383  /* "View.MemoryView":919
16384  *
16385  * if view.ndim == 0:
16386  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16387  * stride = itemsize
16388  * else:
16389  */
16390  __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
16391  if (unlikely(__pyx_v_itemsize == 0)) {
16392  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16393  __PYX_ERR(1, 919, __pyx_L1_error)
16394  }
16395  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16396  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16397  __PYX_ERR(1, 919, __pyx_L1_error)
16398  }
16399  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16400 
16401  /* "View.MemoryView":920
16402  * if view.ndim == 0:
16403  * shape = view.len / itemsize
16404  * stride = itemsize # <<<<<<<<<<<<<<
16405  * else:
16406  * shape = view.shape[dim]
16407  */
16408  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16409  __pyx_v_stride = __pyx_v_itemsize;
16410 
16411  /* "View.MemoryView":918
16412  * cdef char *resultp
16413  *
16414  * if view.ndim == 0: # <<<<<<<<<<<<<<
16415  * shape = view.len / itemsize
16416  * stride = itemsize
16417  */
16418  goto __pyx_L3;
16419  }
16420 
16421  /* "View.MemoryView":922
16422  * stride = itemsize
16423  * else:
16424  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16425  * stride = view.strides[dim]
16426  * if view.suboffsets != NULL:
16427  */
16428  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16429  /*else*/ {
16430  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16431 
16432  /* "View.MemoryView":923
16433  * else:
16434  * shape = view.shape[dim]
16435  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16436  * if view.suboffsets != NULL:
16437  * suboffset = view.suboffsets[dim]
16438  */
16439  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16440  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16441 
16442  /* "View.MemoryView":924
16443  * shape = view.shape[dim]
16444  * stride = view.strides[dim]
16445  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16446  * suboffset = view.suboffsets[dim]
16447  *
16448  */
16449  __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
16450  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16451  if (__pyx_t_2) {
16452 
16453  /* "View.MemoryView":925
16454  * stride = view.strides[dim]
16455  * if view.suboffsets != NULL:
16456  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16457  *
16458  * if index < 0:
16459  */
16460  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16461  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16462 
16463  /* "View.MemoryView":924
16464  * shape = view.shape[dim]
16465  * stride = view.strides[dim]
16466  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16467  * suboffset = view.suboffsets[dim]
16468  *
16469  */
16470  }
16471  }
16472  __pyx_L3:;
16473 
16474  /* "View.MemoryView":927
16475  * suboffset = view.suboffsets[dim]
16476  *
16477  * if index < 0: # <<<<<<<<<<<<<<
16478  * index += view.shape[dim]
16479  * if index < 0:
16480  */
16481  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16482  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16483  if (__pyx_t_2) {
16484 
16485  /* "View.MemoryView":928
16486  *
16487  * if index < 0:
16488  * index += view.shape[dim] # <<<<<<<<<<<<<<
16489  * if index < 0:
16490  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16491  */
16492  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16493  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16494 
16495  /* "View.MemoryView":929
16496  * if index < 0:
16497  * index += view.shape[dim]
16498  * if index < 0: # <<<<<<<<<<<<<<
16499  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16500  *
16501  */
16502  __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
16503  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16504  if (unlikely(__pyx_t_2)) {
16505 
16506  /* "View.MemoryView":930
16507  * index += view.shape[dim]
16508  * if index < 0:
16509  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16510  *
16511  * if index >= shape:
16512  */
16513  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16514  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16515  __Pyx_GOTREF(__pyx_t_3);
16516  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
16517  __Pyx_GOTREF(__pyx_t_4);
16518  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16519  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16520  __Pyx_GOTREF(__pyx_t_3);
16521  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16522  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16523  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16524  __PYX_ERR(1, 930, __pyx_L1_error)
16525 
16526  /* "View.MemoryView":929
16527  * if index < 0:
16528  * index += view.shape[dim]
16529  * if index < 0: # <<<<<<<<<<<<<<
16530  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16531  *
16532  */
16533  }
16534 
16535  /* "View.MemoryView":927
16536  * suboffset = view.suboffsets[dim]
16537  *
16538  * if index < 0: # <<<<<<<<<<<<<<
16539  * index += view.shape[dim]
16540  * if index < 0:
16541  */
16542  }
16543 
16544  /* "View.MemoryView":932
16545  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16546  *
16547  * if index >= shape: # <<<<<<<<<<<<<<
16548  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16549  *
16550  */
16551  __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
16552  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16553  if (unlikely(__pyx_t_2)) {
16554 
16555  /* "View.MemoryView":933
16556  *
16557  * if index >= shape:
16558  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16559  *
16560  * resultp = bufp + index * stride
16561  */
16562  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16563  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16564  __Pyx_GOTREF(__pyx_t_3);
16565  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
16566  __Pyx_GOTREF(__pyx_t_4);
16567  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16568  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16569  __Pyx_GOTREF(__pyx_t_3);
16570  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16571  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16572  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16573  __PYX_ERR(1, 933, __pyx_L1_error)
16574 
16575  /* "View.MemoryView":932
16576  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16577  *
16578  * if index >= shape: # <<<<<<<<<<<<<<
16579  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16580  *
16581  */
16582  }
16583 
16584  /* "View.MemoryView":935
16585  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16586  *
16587  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16588  * if suboffset >= 0:
16589  * resultp = (<char **> resultp)[0] + suboffset
16590  */
16591  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16592  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16593 
16594  /* "View.MemoryView":936
16595  *
16596  * resultp = bufp + index * stride
16597  * if suboffset >= 0: # <<<<<<<<<<<<<<
16598  * resultp = (<char **> resultp)[0] + suboffset
16599  *
16600  */
16601  __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
16602  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16603  if (__pyx_t_2) {
16604 
16605  /* "View.MemoryView":937
16606  * resultp = bufp + index * stride
16607  * if suboffset >= 0:
16608  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16609  *
16610  * return resultp
16611  */
16612  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16613  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16614 
16615  /* "View.MemoryView":936
16616  *
16617  * resultp = bufp + index * stride
16618  * if suboffset >= 0: # <<<<<<<<<<<<<<
16619  * resultp = (<char **> resultp)[0] + suboffset
16620  *
16621  */
16622  }
16623 
16624  /* "View.MemoryView":939
16625  * resultp = (<char **> resultp)[0] + suboffset
16626  *
16627  * return resultp # <<<<<<<<<<<<<<
16628  *
16629  *
16630  */
16631  __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
16632  __pyx_r = __pyx_v_resultp;
16633  goto __pyx_L0;
16634 
16635  /* "View.MemoryView":912
16636  *
16637  * @cname('__pyx_pybuffer_index')
16638  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16639  * Py_ssize_t dim) except NULL:
16640  * cdef Py_ssize_t shape, stride, suboffset = -1
16641  */
16642 
16643  /* function exit code */
16644  __pyx_L1_error:;
16645  __Pyx_XDECREF(__pyx_t_3);
16646  __Pyx_XDECREF(__pyx_t_4);
16647  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16648  __pyx_r = NULL;
16649  __pyx_L0:;
16650  __Pyx_TraceReturn(Py_None, 0);
16651  __Pyx_RefNannyFinishContext();
16652  return __pyx_r;
16653 }
16654 
16655 /* "View.MemoryView":945
16656  *
16657  * @cname('__pyx_memslice_transpose')
16658  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16659  * cdef int ndim = memslice.memview.view.ndim
16660  *
16661  */
16662 
16663 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16664  int __pyx_v_ndim;
16665  Py_ssize_t *__pyx_v_shape;
16666  Py_ssize_t *__pyx_v_strides;
16667  int __pyx_v_i;
16668  int __pyx_v_j;
16669  int __pyx_r;
16670  __Pyx_TraceDeclarations
16671  int __pyx_t_1;
16672  Py_ssize_t *__pyx_t_2;
16673  long __pyx_t_3;
16674  long __pyx_t_4;
16675  Py_ssize_t __pyx_t_5;
16676  Py_ssize_t __pyx_t_6;
16677  int __pyx_t_7;
16678  int __pyx_t_8;
16679  int __pyx_t_9;
16680  int __pyx_lineno = 0;
16681  const char *__pyx_filename = NULL;
16682  int __pyx_clineno = 0;
16683  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
16684 
16685  /* "View.MemoryView":946
16686  * @cname('__pyx_memslice_transpose')
16687  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16688  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16689  *
16690  * cdef Py_ssize_t *shape = memslice.shape
16691  */
16692  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16693  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16694  __pyx_v_ndim = __pyx_t_1;
16695 
16696  /* "View.MemoryView":948
16697  * cdef int ndim = memslice.memview.view.ndim
16698  *
16699  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16700  * cdef Py_ssize_t *strides = memslice.strides
16701  *
16702  */
16703  __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
16704  __pyx_t_2 = __pyx_v_memslice->shape;
16705  __pyx_v_shape = __pyx_t_2;
16706 
16707  /* "View.MemoryView":949
16708  *
16709  * cdef Py_ssize_t *shape = memslice.shape
16710  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16711  *
16712  *
16713  */
16714  __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
16715  __pyx_t_2 = __pyx_v_memslice->strides;
16716  __pyx_v_strides = __pyx_t_2;
16717 
16718  /* "View.MemoryView":953
16719  *
16720  * cdef int i, j
16721  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16722  * j = ndim - 1 - i
16723  * strides[i], strides[j] = strides[j], strides[i]
16724  */
16725  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16726  __pyx_t_3 = (__pyx_v_ndim / 2);
16727  __pyx_t_4 = __pyx_t_3;
16728  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16729  __pyx_v_i = __pyx_t_1;
16730 
16731  /* "View.MemoryView":954
16732  * cdef int i, j
16733  * for i in range(ndim / 2):
16734  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16735  * strides[i], strides[j] = strides[j], strides[i]
16736  * shape[i], shape[j] = shape[j], shape[i]
16737  */
16738  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16739  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16740 
16741  /* "View.MemoryView":955
16742  * for i in range(ndim / 2):
16743  * j = ndim - 1 - i
16744  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16745  * shape[i], shape[j] = shape[j], shape[i]
16746  *
16747  */
16748  __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
16749  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16750  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16751  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16752  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16753 
16754  /* "View.MemoryView":956
16755  * j = ndim - 1 - i
16756  * strides[i], strides[j] = strides[j], strides[i]
16757  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16758  *
16759  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16760  */
16761  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16762  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16763  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16764  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16765  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16766 
16767  /* "View.MemoryView":958
16768  * shape[i], shape[j] = shape[j], shape[i]
16769  *
16770  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16771  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16772  *
16773  */
16774  __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
16775  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16776  if (!__pyx_t_8) {
16777  } else {
16778  __pyx_t_7 = __pyx_t_8;
16779  goto __pyx_L6_bool_binop_done;
16780  }
16781  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16782  __pyx_t_7 = __pyx_t_8;
16783  __pyx_L6_bool_binop_done:;
16784  if (__pyx_t_7) {
16785 
16786  /* "View.MemoryView":959
16787  *
16788  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16789  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16790  *
16791  * return 1
16792  */
16793  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16794  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16795 
16796  /* "View.MemoryView":958
16797  * shape[i], shape[j] = shape[j], shape[i]
16798  *
16799  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16800  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16801  *
16802  */
16803  }
16804  }
16805 
16806  /* "View.MemoryView":961
16807  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16808  *
16809  * return 1 # <<<<<<<<<<<<<<
16810  *
16811  *
16812  */
16813  __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16814  __pyx_r = 1;
16815  goto __pyx_L0;
16816 
16817  /* "View.MemoryView":945
16818  *
16819  * @cname('__pyx_memslice_transpose')
16820  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16821  * cdef int ndim = memslice.memview.view.ndim
16822  *
16823  */
16824 
16825  /* function exit code */
16826  __pyx_L1_error:;
16827  {
16828  #ifdef WITH_THREAD
16829  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16830  #endif
16831  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16832  #ifdef WITH_THREAD
16833  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16834  #endif
16835  }
16836  __pyx_r = 0;
16837  __pyx_L0:;
16838  __Pyx_TraceReturn(Py_None, 1);
16839  return __pyx_r;
16840 }
16841 
16842 /* "View.MemoryView":978
16843  * cdef int (*to_dtype_func)(char *, object) except 0
16844  *
16845  * def __dealloc__(self): # <<<<<<<<<<<<<<
16846  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16847  *
16848  */
16849 
16850 /* Python wrapper */
16851 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16852 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16853  __Pyx_RefNannyDeclarations
16854  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16855  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16856 
16857  /* function exit code */
16858  __Pyx_RefNannyFinishContext();
16859 }
16860 
16861 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16862  __Pyx_TraceDeclarations
16863  __Pyx_RefNannyDeclarations
16864  int __pyx_lineno = 0;
16865  const char *__pyx_filename = NULL;
16866  int __pyx_clineno = 0;
16867  __Pyx_RefNannySetupContext("__dealloc__", 0);
16868  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16869 
16870  /* "View.MemoryView":979
16871  *
16872  * def __dealloc__(self):
16873  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16874  *
16875  * cdef convert_item_to_object(self, char *itemp):
16876  */
16877  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16878  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16879 
16880  /* "View.MemoryView":978
16881  * cdef int (*to_dtype_func)(char *, object) except 0
16882  *
16883  * def __dealloc__(self): # <<<<<<<<<<<<<<
16884  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16885  *
16886  */
16887 
16888  /* function exit code */
16889  goto __pyx_L0;
16890  __pyx_L1_error:;
16891  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16892  __pyx_L0:;
16893  __Pyx_TraceReturn(Py_None, 0);
16894  __Pyx_RefNannyFinishContext();
16895 }
16896 
16897 /* "View.MemoryView":981
16898  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16899  *
16900  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16901  * if self.to_object_func != NULL:
16902  * return self.to_object_func(itemp)
16903  */
16904 
16905 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16906  PyObject *__pyx_r = NULL;
16907  __Pyx_TraceDeclarations
16908  __Pyx_RefNannyDeclarations
16909  int __pyx_t_1;
16910  PyObject *__pyx_t_2 = NULL;
16911  int __pyx_lineno = 0;
16912  const char *__pyx_filename = NULL;
16913  int __pyx_clineno = 0;
16914  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16915  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16916 
16917  /* "View.MemoryView":982
16918  *
16919  * cdef convert_item_to_object(self, char *itemp):
16920  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16921  * return self.to_object_func(itemp)
16922  * else:
16923  */
16924  __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16925  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16926  if (__pyx_t_1) {
16927 
16928  /* "View.MemoryView":983
16929  * cdef convert_item_to_object(self, char *itemp):
16930  * if self.to_object_func != NULL:
16931  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16932  * else:
16933  * return memoryview.convert_item_to_object(self, itemp)
16934  */
16935  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16936  __Pyx_XDECREF(__pyx_r);
16937  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16938  __Pyx_GOTREF(__pyx_t_2);
16939  __pyx_r = __pyx_t_2;
16940  __pyx_t_2 = 0;
16941  goto __pyx_L0;
16942 
16943  /* "View.MemoryView":982
16944  *
16945  * cdef convert_item_to_object(self, char *itemp):
16946  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16947  * return self.to_object_func(itemp)
16948  * else:
16949  */
16950  }
16951 
16952  /* "View.MemoryView":985
16953  * return self.to_object_func(itemp)
16954  * else:
16955  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16956  *
16957  * cdef assign_item_from_object(self, char *itemp, object value):
16958  */
16959  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16960  /*else*/ {
16961  __Pyx_XDECREF(__pyx_r);
16962  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16963  __Pyx_GOTREF(__pyx_t_2);
16964  __pyx_r = __pyx_t_2;
16965  __pyx_t_2 = 0;
16966  goto __pyx_L0;
16967  }
16968 
16969  /* "View.MemoryView":981
16970  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16971  *
16972  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16973  * if self.to_object_func != NULL:
16974  * return self.to_object_func(itemp)
16975  */
16976 
16977  /* function exit code */
16978  __pyx_L1_error:;
16979  __Pyx_XDECREF(__pyx_t_2);
16980  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16981  __pyx_r = 0;
16982  __pyx_L0:;
16983  __Pyx_XGIVEREF(__pyx_r);
16984  __Pyx_TraceReturn(__pyx_r, 0);
16985  __Pyx_RefNannyFinishContext();
16986  return __pyx_r;
16987 }
16988 
16989 /* "View.MemoryView":987
16990  * return memoryview.convert_item_to_object(self, itemp)
16991  *
16992  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16993  * if self.to_dtype_func != NULL:
16994  * self.to_dtype_func(itemp, value)
16995  */
16996 
16997 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16998  PyObject *__pyx_r = NULL;
16999  __Pyx_TraceDeclarations
17000  __Pyx_RefNannyDeclarations
17001  int __pyx_t_1;
17002  int __pyx_t_2;
17003  PyObject *__pyx_t_3 = NULL;
17004  int __pyx_lineno = 0;
17005  const char *__pyx_filename = NULL;
17006  int __pyx_clineno = 0;
17007  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17008  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
17009 
17010  /* "View.MemoryView":988
17011  *
17012  * cdef assign_item_from_object(self, char *itemp, object value):
17013  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17014  * self.to_dtype_func(itemp, value)
17015  * else:
17016  */
17017  __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
17018  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17019  if (__pyx_t_1) {
17020 
17021  /* "View.MemoryView":989
17022  * cdef assign_item_from_object(self, char *itemp, object value):
17023  * if self.to_dtype_func != NULL:
17024  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17025  * else:
17026  * memoryview.assign_item_from_object(self, itemp, value)
17027  */
17028  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
17029  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
17030 
17031  /* "View.MemoryView":988
17032  *
17033  * cdef assign_item_from_object(self, char *itemp, object value):
17034  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17035  * self.to_dtype_func(itemp, value)
17036  * else:
17037  */
17038  goto __pyx_L3;
17039  }
17040 
17041  /* "View.MemoryView":991
17042  * self.to_dtype_func(itemp, value)
17043  * else:
17044  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17045  *
17046  * @property
17047  */
17048  __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
17049  /*else*/ {
17050  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
17051  __Pyx_GOTREF(__pyx_t_3);
17052  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17053  }
17054  __pyx_L3:;
17055 
17056  /* "View.MemoryView":987
17057  * return memoryview.convert_item_to_object(self, itemp)
17058  *
17059  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17060  * if self.to_dtype_func != NULL:
17061  * self.to_dtype_func(itemp, value)
17062  */
17063 
17064  /* function exit code */
17065  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17066  goto __pyx_L0;
17067  __pyx_L1_error:;
17068  __Pyx_XDECREF(__pyx_t_3);
17069  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17070  __pyx_r = 0;
17071  __pyx_L0:;
17072  __Pyx_XGIVEREF(__pyx_r);
17073  __Pyx_TraceReturn(__pyx_r, 0);
17074  __Pyx_RefNannyFinishContext();
17075  return __pyx_r;
17076 }
17077 
17078 /* "View.MemoryView":994
17079  *
17080  * @property
17081  * def base(self): # <<<<<<<<<<<<<<
17082  * return self.from_object
17083  *
17084  */
17085 
17086 /* Python wrapper */
17087 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17088 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17089  PyObject *__pyx_r = 0;
17090  __Pyx_RefNannyDeclarations
17091  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17092  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17093 
17094  /* function exit code */
17095  __Pyx_RefNannyFinishContext();
17096  return __pyx_r;
17097 }
17098 
17099 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17100  PyObject *__pyx_r = NULL;
17101  __Pyx_TraceDeclarations
17102  __Pyx_RefNannyDeclarations
17103  int __pyx_lineno = 0;
17104  const char *__pyx_filename = NULL;
17105  int __pyx_clineno = 0;
17106  __Pyx_RefNannySetupContext("__get__", 0);
17107  __Pyx_TraceCall("__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
17108 
17109  /* "View.MemoryView":995
17110  * @property
17111  * def base(self):
17112  * return self.from_object # <<<<<<<<<<<<<<
17113  *
17114  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17115  */
17116  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
17117  __Pyx_XDECREF(__pyx_r);
17118  __Pyx_INCREF(__pyx_v_self->from_object);
17119  __pyx_r = __pyx_v_self->from_object;
17120  goto __pyx_L0;
17121 
17122  /* "View.MemoryView":994
17123  *
17124  * @property
17125  * def base(self): # <<<<<<<<<<<<<<
17126  * return self.from_object
17127  *
17128  */
17129 
17130  /* function exit code */
17131  __pyx_L1_error:;
17132  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17133  __pyx_r = NULL;
17134  __pyx_L0:;
17135  __Pyx_XGIVEREF(__pyx_r);
17136  __Pyx_TraceReturn(__pyx_r, 0);
17137  __Pyx_RefNannyFinishContext();
17138  return __pyx_r;
17139 }
17140 
17141 /* "(tree fragment)":1
17142  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17143  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17144  * def __setstate_cython__(self, __pyx_state):
17145  */
17146 
17147 /* Python wrapper */
17148 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17149 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17150 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17151  PyObject *__pyx_r = 0;
17152  __Pyx_RefNannyDeclarations
17153  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17154  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17155 
17156  /* function exit code */
17157  __Pyx_RefNannyFinishContext();
17158  return __pyx_r;
17159 }
17160 
17161 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17162  PyObject *__pyx_r = NULL;
17163  __Pyx_TraceDeclarations
17164  __Pyx_RefNannyDeclarations
17165  PyObject *__pyx_t_1 = NULL;
17166  int __pyx_lineno = 0;
17167  const char *__pyx_filename = NULL;
17168  int __pyx_clineno = 0;
17169  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17170  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17171 
17172  /* "(tree fragment)":2
17173  * def __reduce_cython__(self):
17174  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17175  * def __setstate_cython__(self, __pyx_state):
17176  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17177  */
17178  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
17179  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17180  __Pyx_GOTREF(__pyx_t_1);
17181  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17182  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17183  __PYX_ERR(1, 2, __pyx_L1_error)
17184 
17185  /* "(tree fragment)":1
17186  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17187  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17188  * def __setstate_cython__(self, __pyx_state):
17189  */
17190 
17191  /* function exit code */
17192  __pyx_L1_error:;
17193  __Pyx_XDECREF(__pyx_t_1);
17194  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17195  __pyx_r = NULL;
17196  __Pyx_XGIVEREF(__pyx_r);
17197  __Pyx_TraceReturn(__pyx_r, 0);
17198  __Pyx_RefNannyFinishContext();
17199  return __pyx_r;
17200 }
17201 
17202 /* "(tree fragment)":3
17203  * def __reduce_cython__(self):
17204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17205  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17206  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17207  */
17208 
17209 /* Python wrapper */
17210 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17211 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17212 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17213  PyObject *__pyx_r = 0;
17214  __Pyx_RefNannyDeclarations
17215  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17216  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17217 
17218  /* function exit code */
17219  __Pyx_RefNannyFinishContext();
17220  return __pyx_r;
17221 }
17222 
17223 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17224  PyObject *__pyx_r = NULL;
17225  __Pyx_TraceDeclarations
17226  __Pyx_RefNannyDeclarations
17227  PyObject *__pyx_t_1 = NULL;
17228  int __pyx_lineno = 0;
17229  const char *__pyx_filename = NULL;
17230  int __pyx_clineno = 0;
17231  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17232  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17233 
17234  /* "(tree fragment)":4
17235  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17236  * def __setstate_cython__(self, __pyx_state):
17237  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17238  */
17239  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
17240  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17241  __Pyx_GOTREF(__pyx_t_1);
17242  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17243  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17244  __PYX_ERR(1, 4, __pyx_L1_error)
17245 
17246  /* "(tree fragment)":3
17247  * def __reduce_cython__(self):
17248  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17249  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17250  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17251  */
17252 
17253  /* function exit code */
17254  __pyx_L1_error:;
17255  __Pyx_XDECREF(__pyx_t_1);
17256  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17257  __pyx_r = NULL;
17258  __Pyx_XGIVEREF(__pyx_r);
17259  __Pyx_TraceReturn(__pyx_r, 0);
17260  __Pyx_RefNannyFinishContext();
17261  return __pyx_r;
17262 }
17263 
17264 /* "View.MemoryView":1001
17265  *
17266  * @cname('__pyx_memoryview_fromslice')
17267  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17268  * int ndim,
17269  * object (*to_object_func)(char *),
17270  */
17271 
17272 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17273  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17274  Py_ssize_t __pyx_v_suboffset;
17275  PyObject *__pyx_v_length = NULL;
17276  PyObject *__pyx_r = NULL;
17277  __Pyx_TraceDeclarations
17278  __Pyx_RefNannyDeclarations
17279  int __pyx_t_1;
17280  PyObject *__pyx_t_2 = NULL;
17281  PyObject *__pyx_t_3 = NULL;
17282  __Pyx_TypeInfo *__pyx_t_4;
17283  Py_buffer __pyx_t_5;
17284  Py_ssize_t *__pyx_t_6;
17285  Py_ssize_t *__pyx_t_7;
17286  Py_ssize_t *__pyx_t_8;
17287  Py_ssize_t __pyx_t_9;
17288  int __pyx_lineno = 0;
17289  const char *__pyx_filename = NULL;
17290  int __pyx_clineno = 0;
17291  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17292  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
17293 
17294  /* "View.MemoryView":1009
17295  * cdef _memoryviewslice result
17296  *
17297  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17298  * return None
17299  *
17300  */
17301  __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
17302  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17303  if (__pyx_t_1) {
17304 
17305  /* "View.MemoryView":1010
17306  *
17307  * if <PyObject *> memviewslice.memview == Py_None:
17308  * return None # <<<<<<<<<<<<<<
17309  *
17310  *
17311  */
17312  __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
17313  __Pyx_XDECREF(__pyx_r);
17314  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17315  goto __pyx_L0;
17316 
17317  /* "View.MemoryView":1009
17318  * cdef _memoryviewslice result
17319  *
17320  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17321  * return None
17322  *
17323  */
17324  }
17325 
17326  /* "View.MemoryView":1015
17327  *
17328  *
17329  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17330  *
17331  * result.from_slice = memviewslice
17332  */
17333  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17334  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17335  __Pyx_GOTREF(__pyx_t_2);
17336  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
17337  __Pyx_GOTREF(__pyx_t_3);
17338  __Pyx_INCREF(Py_None);
17339  __Pyx_GIVEREF(Py_None);
17340  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17341  __Pyx_INCREF(__pyx_int_0);
17342  __Pyx_GIVEREF(__pyx_int_0);
17343  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17344  __Pyx_GIVEREF(__pyx_t_2);
17345  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17346  __pyx_t_2 = 0;
17347  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17348  __Pyx_GOTREF(__pyx_t_2);
17349  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17350  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17351  __pyx_t_2 = 0;
17352 
17353  /* "View.MemoryView":1017
17354  * result = _memoryviewslice(None, 0, dtype_is_object)
17355  *
17356  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17357  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17358  *
17359  */
17360  __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
17361  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17362 
17363  /* "View.MemoryView":1018
17364  *
17365  * result.from_slice = memviewslice
17366  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17367  *
17368  * result.from_object = (<memoryview> memviewslice.memview).base
17369  */
17370  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17371  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17372 
17373  /* "View.MemoryView":1020
17374  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17375  *
17376  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17377  * result.typeinfo = memviewslice.memview.typeinfo
17378  *
17379  */
17380  __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
17381  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
17382  __Pyx_GOTREF(__pyx_t_2);
17383  __Pyx_GIVEREF(__pyx_t_2);
17384  __Pyx_GOTREF(__pyx_v_result->from_object);
17385  __Pyx_DECREF(__pyx_v_result->from_object);
17386  __pyx_v_result->from_object = __pyx_t_2;
17387  __pyx_t_2 = 0;
17388 
17389  /* "View.MemoryView":1021
17390  *
17391  * result.from_object = (<memoryview> memviewslice.memview).base
17392  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17393  *
17394  * result.view = memviewslice.memview.view
17395  */
17396  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17397  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17398  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17399 
17400  /* "View.MemoryView":1023
17401  * result.typeinfo = memviewslice.memview.typeinfo
17402  *
17403  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17404  * result.view.buf = <void *> memviewslice.data
17405  * result.view.ndim = ndim
17406  */
17407  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17408  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17409  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17410 
17411  /* "View.MemoryView":1024
17412  *
17413  * result.view = memviewslice.memview.view
17414  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17415  * result.view.ndim = ndim
17416  * (<__pyx_buffer *> &result.view).obj = Py_None
17417  */
17418  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17419  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17420 
17421  /* "View.MemoryView":1025
17422  * result.view = memviewslice.memview.view
17423  * result.view.buf = <void *> memviewslice.data
17424  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17425  * (<__pyx_buffer *> &result.view).obj = Py_None
17426  * Py_INCREF(Py_None)
17427  */
17428  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17429  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17430 
17431  /* "View.MemoryView":1026
17432  * result.view.buf = <void *> memviewslice.data
17433  * result.view.ndim = ndim
17434  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17435  * Py_INCREF(Py_None)
17436  *
17437  */
17438  __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
17439  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17440 
17441  /* "View.MemoryView":1027
17442  * result.view.ndim = ndim
17443  * (<__pyx_buffer *> &result.view).obj = Py_None
17444  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17445  *
17446  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17447  */
17448  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17449  Py_INCREF(Py_None);
17450 
17451  /* "View.MemoryView":1029
17452  * Py_INCREF(Py_None)
17453  *
17454  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17455  * result.flags = PyBUF_RECORDS
17456  * else:
17457  */
17458  __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
17459  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17460  if (__pyx_t_1) {
17461 
17462  /* "View.MemoryView":1030
17463  *
17464  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17465  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17466  * else:
17467  * result.flags = PyBUF_RECORDS_RO
17468  */
17469  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17470  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17471 
17472  /* "View.MemoryView":1029
17473  * Py_INCREF(Py_None)
17474  *
17475  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17476  * result.flags = PyBUF_RECORDS
17477  * else:
17478  */
17479  goto __pyx_L4;
17480  }
17481 
17482  /* "View.MemoryView":1032
17483  * result.flags = PyBUF_RECORDS
17484  * else:
17485  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17486  *
17487  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17488  */
17489  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17490  /*else*/ {
17491  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17492  }
17493  __pyx_L4:;
17494 
17495  /* "View.MemoryView":1034
17496  * result.flags = PyBUF_RECORDS_RO
17497  *
17498  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17499  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17500  *
17501  */
17502  __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
17503  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17504 
17505  /* "View.MemoryView":1035
17506  *
17507  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17508  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17509  *
17510  *
17511  */
17512  __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
17513  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17514 
17515  /* "View.MemoryView":1038
17516  *
17517  *
17518  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17519  * for suboffset in result.from_slice.suboffsets[:ndim]:
17520  * if suboffset >= 0:
17521  */
17522  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17523  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17524 
17525  /* "View.MemoryView":1039
17526  *
17527  * result.view.suboffsets = NULL
17528  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17529  * if suboffset >= 0:
17530  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17531  */
17532  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17533  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17534  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17535  __pyx_t_6 = __pyx_t_8;
17536  __pyx_v_suboffset = (__pyx_t_6[0]);
17537 
17538  /* "View.MemoryView":1040
17539  * result.view.suboffsets = NULL
17540  * for suboffset in result.from_slice.suboffsets[:ndim]:
17541  * if suboffset >= 0: # <<<<<<<<<<<<<<
17542  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17543  * break
17544  */
17545  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17546  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17547  if (__pyx_t_1) {
17548 
17549  /* "View.MemoryView":1041
17550  * for suboffset in result.from_slice.suboffsets[:ndim]:
17551  * if suboffset >= 0:
17552  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17553  * break
17554  *
17555  */
17556  __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
17557  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17558 
17559  /* "View.MemoryView":1042
17560  * if suboffset >= 0:
17561  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17562  * break # <<<<<<<<<<<<<<
17563  *
17564  * result.view.len = result.view.itemsize
17565  */
17566  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17567  goto __pyx_L6_break;
17568 
17569  /* "View.MemoryView":1040
17570  * result.view.suboffsets = NULL
17571  * for suboffset in result.from_slice.suboffsets[:ndim]:
17572  * if suboffset >= 0: # <<<<<<<<<<<<<<
17573  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17574  * break
17575  */
17576  }
17577  }
17578  __pyx_L6_break:;
17579 
17580  /* "View.MemoryView":1044
17581  * break
17582  *
17583  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17584  * for length in result.view.shape[:ndim]:
17585  * result.view.len *= length
17586  */
17587  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17588  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17589  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17590 
17591  /* "View.MemoryView":1045
17592  *
17593  * result.view.len = result.view.itemsize
17594  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17595  * result.view.len *= length
17596  *
17597  */
17598  __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
17599  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17600  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17601  __pyx_t_6 = __pyx_t_8;
17602  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
17603  __Pyx_GOTREF(__pyx_t_2);
17604  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17605  __pyx_t_2 = 0;
17606 
17607  /* "View.MemoryView":1046
17608  * result.view.len = result.view.itemsize
17609  * for length in result.view.shape[:ndim]:
17610  * result.view.len *= length # <<<<<<<<<<<<<<
17611  *
17612  * result.to_object_func = to_object_func
17613  */
17614  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17615  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
17616  __Pyx_GOTREF(__pyx_t_2);
17617  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
17618  __Pyx_GOTREF(__pyx_t_3);
17619  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17620  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
17621  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17622  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17623  }
17624 
17625  /* "View.MemoryView":1048
17626  * result.view.len *= length
17627  *
17628  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17629  * result.to_dtype_func = to_dtype_func
17630  *
17631  */
17632  __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
17633  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17634 
17635  /* "View.MemoryView":1049
17636  *
17637  * result.to_object_func = to_object_func
17638  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17639  *
17640  * return result
17641  */
17642  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17643  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17644 
17645  /* "View.MemoryView":1051
17646  * result.to_dtype_func = to_dtype_func
17647  *
17648  * return result # <<<<<<<<<<<<<<
17649  *
17650  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17651  */
17652  __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
17653  __Pyx_XDECREF(__pyx_r);
17654  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17655  __pyx_r = ((PyObject *)__pyx_v_result);
17656  goto __pyx_L0;
17657 
17658  /* "View.MemoryView":1001
17659  *
17660  * @cname('__pyx_memoryview_fromslice')
17661  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17662  * int ndim,
17663  * object (*to_object_func)(char *),
17664  */
17665 
17666  /* function exit code */
17667  __pyx_L1_error:;
17668  __Pyx_XDECREF(__pyx_t_2);
17669  __Pyx_XDECREF(__pyx_t_3);
17670  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17671  __pyx_r = 0;
17672  __pyx_L0:;
17673  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17674  __Pyx_XDECREF(__pyx_v_length);
17675  __Pyx_XGIVEREF(__pyx_r);
17676  __Pyx_TraceReturn(__pyx_r, 0);
17677  __Pyx_RefNannyFinishContext();
17678  return __pyx_r;
17679 }
17680 
17681 /* "View.MemoryView":1054
17682  *
17683  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17684  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17685  * __Pyx_memviewslice *mslice) except NULL:
17686  * cdef _memoryviewslice obj
17687  */
17688 
17689 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17690  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17691  __Pyx_memviewslice *__pyx_r;
17692  __Pyx_TraceDeclarations
17693  __Pyx_RefNannyDeclarations
17694  int __pyx_t_1;
17695  int __pyx_t_2;
17696  PyObject *__pyx_t_3 = NULL;
17697  int __pyx_lineno = 0;
17698  const char *__pyx_filename = NULL;
17699  int __pyx_clineno = 0;
17700  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17701  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
17702 
17703  /* "View.MemoryView":1057
17704  * __Pyx_memviewslice *mslice) except NULL:
17705  * cdef _memoryviewslice obj
17706  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17707  * obj = memview
17708  * return &obj.from_slice
17709  */
17710  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17711  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17712  __pyx_t_2 = (__pyx_t_1 != 0);
17713  if (__pyx_t_2) {
17714 
17715  /* "View.MemoryView":1058
17716  * cdef _memoryviewslice obj
17717  * if isinstance(memview, _memoryviewslice):
17718  * obj = memview # <<<<<<<<<<<<<<
17719  * return &obj.from_slice
17720  * else:
17721  */
17722  __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
17723  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
17724  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17725  __Pyx_INCREF(__pyx_t_3);
17726  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17727  __pyx_t_3 = 0;
17728 
17729  /* "View.MemoryView":1059
17730  * if isinstance(memview, _memoryviewslice):
17731  * obj = memview
17732  * return &obj.from_slice # <<<<<<<<<<<<<<
17733  * else:
17734  * slice_copy(memview, mslice)
17735  */
17736  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17737  __pyx_r = (&__pyx_v_obj->from_slice);
17738  goto __pyx_L0;
17739 
17740  /* "View.MemoryView":1057
17741  * __Pyx_memviewslice *mslice) except NULL:
17742  * cdef _memoryviewslice obj
17743  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17744  * obj = memview
17745  * return &obj.from_slice
17746  */
17747  }
17748 
17749  /* "View.MemoryView":1061
17750  * return &obj.from_slice
17751  * else:
17752  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17753  * return mslice
17754  *
17755  */
17756  __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
17757  /*else*/ {
17758  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17759 
17760  /* "View.MemoryView":1062
17761  * else:
17762  * slice_copy(memview, mslice)
17763  * return mslice # <<<<<<<<<<<<<<
17764  *
17765  * @cname('__pyx_memoryview_slice_copy')
17766  */
17767  __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
17768  __pyx_r = __pyx_v_mslice;
17769  goto __pyx_L0;
17770  }
17771 
17772  /* "View.MemoryView":1054
17773  *
17774  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17775  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17776  * __Pyx_memviewslice *mslice) except NULL:
17777  * cdef _memoryviewslice obj
17778  */
17779 
17780  /* function exit code */
17781  __pyx_L1_error:;
17782  __Pyx_XDECREF(__pyx_t_3);
17783  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17784  __pyx_r = NULL;
17785  __pyx_L0:;
17786  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17787  __Pyx_TraceReturn(Py_None, 0);
17788  __Pyx_RefNannyFinishContext();
17789  return __pyx_r;
17790 }
17791 
17792 /* "View.MemoryView":1065
17793  *
17794  * @cname('__pyx_memoryview_slice_copy')
17795  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17796  * cdef int dim
17797  * cdef (Py_ssize_t*) shape, strides, suboffsets
17798  */
17799 
17800 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17801  int __pyx_v_dim;
17802  Py_ssize_t *__pyx_v_shape;
17803  Py_ssize_t *__pyx_v_strides;
17804  Py_ssize_t *__pyx_v_suboffsets;
17805  __Pyx_TraceDeclarations
17806  __Pyx_RefNannyDeclarations
17807  Py_ssize_t *__pyx_t_1;
17808  int __pyx_t_2;
17809  int __pyx_t_3;
17810  int __pyx_t_4;
17811  Py_ssize_t __pyx_t_5;
17812  int __pyx_lineno = 0;
17813  const char *__pyx_filename = NULL;
17814  int __pyx_clineno = 0;
17815  __Pyx_RefNannySetupContext("slice_copy", 0);
17816  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17817 
17818  /* "View.MemoryView":1069
17819  * cdef (Py_ssize_t*) shape, strides, suboffsets
17820  *
17821  * shape = memview.view.shape # <<<<<<<<<<<<<<
17822  * strides = memview.view.strides
17823  * suboffsets = memview.view.suboffsets
17824  */
17825  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17826  __pyx_t_1 = __pyx_v_memview->view.shape;
17827  __pyx_v_shape = __pyx_t_1;
17828 
17829  /* "View.MemoryView":1070
17830  *
17831  * shape = memview.view.shape
17832  * strides = memview.view.strides # <<<<<<<<<<<<<<
17833  * suboffsets = memview.view.suboffsets
17834  *
17835  */
17836  __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17837  __pyx_t_1 = __pyx_v_memview->view.strides;
17838  __pyx_v_strides = __pyx_t_1;
17839 
17840  /* "View.MemoryView":1071
17841  * shape = memview.view.shape
17842  * strides = memview.view.strides
17843  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17844  *
17845  * dst.memview = <__pyx_memoryview *> memview
17846  */
17847  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17848  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17849  __pyx_v_suboffsets = __pyx_t_1;
17850 
17851  /* "View.MemoryView":1073
17852  * suboffsets = memview.view.suboffsets
17853  *
17854  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17855  * dst.data = <char *> memview.view.buf
17856  *
17857  */
17858  __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17859  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17860 
17861  /* "View.MemoryView":1074
17862  *
17863  * dst.memview = <__pyx_memoryview *> memview
17864  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17865  *
17866  * for dim in range(memview.view.ndim):
17867  */
17868  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17869  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17870 
17871  /* "View.MemoryView":1076
17872  * dst.data = <char *> memview.view.buf
17873  *
17874  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17875  * dst.shape[dim] = shape[dim]
17876  * dst.strides[dim] = strides[dim]
17877  */
17878  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17879  __pyx_t_2 = __pyx_v_memview->view.ndim;
17880  __pyx_t_3 = __pyx_t_2;
17881  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17882  __pyx_v_dim = __pyx_t_4;
17883 
17884  /* "View.MemoryView":1077
17885  *
17886  * for dim in range(memview.view.ndim):
17887  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17888  * dst.strides[dim] = strides[dim]
17889  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17890  */
17891  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17892  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17893 
17894  /* "View.MemoryView":1078
17895  * for dim in range(memview.view.ndim):
17896  * dst.shape[dim] = shape[dim]
17897  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17898  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17899  *
17900  */
17901  __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17902  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17903 
17904  /* "View.MemoryView":1079
17905  * dst.shape[dim] = shape[dim]
17906  * dst.strides[dim] = strides[dim]
17907  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17908  *
17909  * @cname('__pyx_memoryview_copy_object')
17910  */
17911  __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17912  if ((__pyx_v_suboffsets != 0)) {
17913  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17914  } else {
17915  __pyx_t_5 = -1L;
17916  }
17917  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17918  }
17919 
17920  /* "View.MemoryView":1065
17921  *
17922  * @cname('__pyx_memoryview_slice_copy')
17923  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17924  * cdef int dim
17925  * cdef (Py_ssize_t*) shape, strides, suboffsets
17926  */
17927 
17928  /* function exit code */
17929  goto __pyx_L0;
17930  __pyx_L1_error:;
17931  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17932  __pyx_L0:;
17933  __Pyx_TraceReturn(Py_None, 0);
17934  __Pyx_RefNannyFinishContext();
17935 }
17936 
17937 /* "View.MemoryView":1082
17938  *
17939  * @cname('__pyx_memoryview_copy_object')
17940  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17941  * "Create a new memoryview object"
17942  * cdef __Pyx_memviewslice memviewslice
17943  */
17944 
17945 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17946  __Pyx_memviewslice __pyx_v_memviewslice;
17947  PyObject *__pyx_r = NULL;
17948  __Pyx_TraceDeclarations
17949  __Pyx_RefNannyDeclarations
17950  PyObject *__pyx_t_1 = NULL;
17951  int __pyx_lineno = 0;
17952  const char *__pyx_filename = NULL;
17953  int __pyx_clineno = 0;
17954  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17955  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17956 
17957  /* "View.MemoryView":1085
17958  * "Create a new memoryview object"
17959  * cdef __Pyx_memviewslice memviewslice
17960  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17961  * return memoryview_copy_from_slice(memview, &memviewslice)
17962  *
17963  */
17964  __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17965  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17966 
17967  /* "View.MemoryView":1086
17968  * cdef __Pyx_memviewslice memviewslice
17969  * slice_copy(memview, &memviewslice)
17970  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17971  *
17972  * @cname('__pyx_memoryview_copy_object_from_slice')
17973  */
17974  __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17975  __Pyx_XDECREF(__pyx_r);
17976  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17977  __Pyx_GOTREF(__pyx_t_1);
17978  __pyx_r = __pyx_t_1;
17979  __pyx_t_1 = 0;
17980  goto __pyx_L0;
17981 
17982  /* "View.MemoryView":1082
17983  *
17984  * @cname('__pyx_memoryview_copy_object')
17985  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17986  * "Create a new memoryview object"
17987  * cdef __Pyx_memviewslice memviewslice
17988  */
17989 
17990  /* function exit code */
17991  __pyx_L1_error:;
17992  __Pyx_XDECREF(__pyx_t_1);
17993  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17994  __pyx_r = 0;
17995  __pyx_L0:;
17996  __Pyx_XGIVEREF(__pyx_r);
17997  __Pyx_TraceReturn(__pyx_r, 0);
17998  __Pyx_RefNannyFinishContext();
17999  return __pyx_r;
18000 }
18001 
18002 /* "View.MemoryView":1089
18003  *
18004  * @cname('__pyx_memoryview_copy_object_from_slice')
18005  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18006  * """
18007  * Create a new memoryview object from a given memoryview object and slice.
18008  */
18009 
18010 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18011  PyObject *(*__pyx_v_to_object_func)(char *);
18012  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18013  PyObject *__pyx_r = NULL;
18014  __Pyx_TraceDeclarations
18015  __Pyx_RefNannyDeclarations
18016  int __pyx_t_1;
18017  int __pyx_t_2;
18018  PyObject *(*__pyx_t_3)(char *);
18019  int (*__pyx_t_4)(char *, PyObject *);
18020  PyObject *__pyx_t_5 = NULL;
18021  int __pyx_lineno = 0;
18022  const char *__pyx_filename = NULL;
18023  int __pyx_clineno = 0;
18024  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18025  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
18026 
18027  /* "View.MemoryView":1096
18028  * cdef int (*to_dtype_func)(char *, object) except 0
18029  *
18030  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18031  * to_object_func = (<_memoryviewslice> memview).to_object_func
18032  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18033  */
18034  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
18035  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18036  __pyx_t_2 = (__pyx_t_1 != 0);
18037  if (__pyx_t_2) {
18038 
18039  /* "View.MemoryView":1097
18040  *
18041  * if isinstance(memview, _memoryviewslice):
18042  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18043  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18044  * else:
18045  */
18046  __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
18047  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18048  __pyx_v_to_object_func = __pyx_t_3;
18049 
18050  /* "View.MemoryView":1098
18051  * if isinstance(memview, _memoryviewslice):
18052  * to_object_func = (<_memoryviewslice> memview).to_object_func
18053  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18054  * else:
18055  * to_object_func = NULL
18056  */
18057  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
18058  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18059  __pyx_v_to_dtype_func = __pyx_t_4;
18060 
18061  /* "View.MemoryView":1096
18062  * cdef int (*to_dtype_func)(char *, object) except 0
18063  *
18064  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18065  * to_object_func = (<_memoryviewslice> memview).to_object_func
18066  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18067  */
18068  goto __pyx_L3;
18069  }
18070 
18071  /* "View.MemoryView":1100
18072  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18073  * else:
18074  * to_object_func = NULL # <<<<<<<<<<<<<<
18075  * to_dtype_func = NULL
18076  *
18077  */
18078  __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
18079  /*else*/ {
18080  __pyx_v_to_object_func = NULL;
18081 
18082  /* "View.MemoryView":1101
18083  * else:
18084  * to_object_func = NULL
18085  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18086  *
18087  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18088  */
18089  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
18090  __pyx_v_to_dtype_func = NULL;
18091  }
18092  __pyx_L3:;
18093 
18094  /* "View.MemoryView":1103
18095  * to_dtype_func = NULL
18096  *
18097  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18098  * to_object_func, to_dtype_func,
18099  * memview.dtype_is_object)
18100  */
18101  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
18102  __Pyx_XDECREF(__pyx_r);
18103 
18104  /* "View.MemoryView":1105
18105  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18106  * to_object_func, to_dtype_func,
18107  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18108  *
18109  *
18110  */
18111  __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
18112  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
18113  __Pyx_GOTREF(__pyx_t_5);
18114  __pyx_r = __pyx_t_5;
18115  __pyx_t_5 = 0;
18116  goto __pyx_L0;
18117 
18118  /* "View.MemoryView":1089
18119  *
18120  * @cname('__pyx_memoryview_copy_object_from_slice')
18121  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18122  * """
18123  * Create a new memoryview object from a given memoryview object and slice.
18124  */
18125 
18126  /* function exit code */
18127  __pyx_L1_error:;
18128  __Pyx_XDECREF(__pyx_t_5);
18129  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18130  __pyx_r = 0;
18131  __pyx_L0:;
18132  __Pyx_XGIVEREF(__pyx_r);
18133  __Pyx_TraceReturn(__pyx_r, 0);
18134  __Pyx_RefNannyFinishContext();
18135  return __pyx_r;
18136 }
18137 
18138 /* "View.MemoryView":1111
18139  *
18140  *
18141  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18142  * if arg < 0:
18143  * return -arg
18144  */
18145 
18146 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18147  Py_ssize_t __pyx_r;
18148  __Pyx_TraceDeclarations
18149  int __pyx_t_1;
18150  int __pyx_lineno = 0;
18151  const char *__pyx_filename = NULL;
18152  int __pyx_clineno = 0;
18153  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
18154 
18155  /* "View.MemoryView":1112
18156  *
18157  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18158  * if arg < 0: # <<<<<<<<<<<<<<
18159  * return -arg
18160  * else:
18161  */
18162  __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
18163  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18164  if (__pyx_t_1) {
18165 
18166  /* "View.MemoryView":1113
18167  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18168  * if arg < 0:
18169  * return -arg # <<<<<<<<<<<<<<
18170  * else:
18171  * return arg
18172  */
18173  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
18174  __pyx_r = (-__pyx_v_arg);
18175  goto __pyx_L0;
18176 
18177  /* "View.MemoryView":1112
18178  *
18179  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18180  * if arg < 0: # <<<<<<<<<<<<<<
18181  * return -arg
18182  * else:
18183  */
18184  }
18185 
18186  /* "View.MemoryView":1115
18187  * return -arg
18188  * else:
18189  * return arg # <<<<<<<<<<<<<<
18190  *
18191  * @cname('__pyx_get_best_slice_order')
18192  */
18193  __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
18194  /*else*/ {
18195  __pyx_r = __pyx_v_arg;
18196  goto __pyx_L0;
18197  }
18198 
18199  /* "View.MemoryView":1111
18200  *
18201  *
18202  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18203  * if arg < 0:
18204  * return -arg
18205  */
18206 
18207  /* function exit code */
18208  __pyx_L1_error:;
18209  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18210  __pyx_r = 0;
18211  __pyx_L0:;
18212  __Pyx_TraceReturn(Py_None, 1);
18213  return __pyx_r;
18214 }
18215 
18216 /* "View.MemoryView":1118
18217  *
18218  * @cname('__pyx_get_best_slice_order')
18219  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18220  * """
18221  * Figure out the best memory access order for a given slice.
18222  */
18223 
18224 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18225  int __pyx_v_i;
18226  Py_ssize_t __pyx_v_c_stride;
18227  Py_ssize_t __pyx_v_f_stride;
18228  char __pyx_r;
18229  __Pyx_TraceDeclarations
18230  int __pyx_t_1;
18231  int __pyx_t_2;
18232  int __pyx_t_3;
18233  int __pyx_t_4;
18234  int __pyx_lineno = 0;
18235  const char *__pyx_filename = NULL;
18236  int __pyx_clineno = 0;
18237  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
18238 
18239  /* "View.MemoryView":1123
18240  * """
18241  * cdef int i
18242  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18243  * cdef Py_ssize_t f_stride = 0
18244  *
18245  */
18246  __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
18247  __pyx_v_c_stride = 0;
18248 
18249  /* "View.MemoryView":1124
18250  * cdef int i
18251  * cdef Py_ssize_t c_stride = 0
18252  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18253  *
18254  * for i in range(ndim - 1, -1, -1):
18255  */
18256  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
18257  __pyx_v_f_stride = 0;
18258 
18259  /* "View.MemoryView":1126
18260  * cdef Py_ssize_t f_stride = 0
18261  *
18262  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18263  * if mslice.shape[i] > 1:
18264  * c_stride = mslice.strides[i]
18265  */
18266  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
18267  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18268  __pyx_v_i = __pyx_t_1;
18269 
18270  /* "View.MemoryView":1127
18271  *
18272  * for i in range(ndim - 1, -1, -1):
18273  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18274  * c_stride = mslice.strides[i]
18275  * break
18276  */
18277  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
18278  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18279  if (__pyx_t_2) {
18280 
18281  /* "View.MemoryView":1128
18282  * for i in range(ndim - 1, -1, -1):
18283  * if mslice.shape[i] > 1:
18284  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18285  * break
18286  *
18287  */
18288  __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
18289  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18290 
18291  /* "View.MemoryView":1129
18292  * if mslice.shape[i] > 1:
18293  * c_stride = mslice.strides[i]
18294  * break # <<<<<<<<<<<<<<
18295  *
18296  * for i in range(ndim):
18297  */
18298  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
18299  goto __pyx_L4_break;
18300 
18301  /* "View.MemoryView":1127
18302  *
18303  * for i in range(ndim - 1, -1, -1):
18304  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18305  * c_stride = mslice.strides[i]
18306  * break
18307  */
18308  }
18309  }
18310  __pyx_L4_break:;
18311 
18312  /* "View.MemoryView":1131
18313  * break
18314  *
18315  * for i in range(ndim): # <<<<<<<<<<<<<<
18316  * if mslice.shape[i] > 1:
18317  * f_stride = mslice.strides[i]
18318  */
18319  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18320  __pyx_t_1 = __pyx_v_ndim;
18321  __pyx_t_3 = __pyx_t_1;
18322  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18323  __pyx_v_i = __pyx_t_4;
18324 
18325  /* "View.MemoryView":1132
18326  *
18327  * for i in range(ndim):
18328  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18329  * f_stride = mslice.strides[i]
18330  * break
18331  */
18332  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18333  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18334  if (__pyx_t_2) {
18335 
18336  /* "View.MemoryView":1133
18337  * for i in range(ndim):
18338  * if mslice.shape[i] > 1:
18339  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18340  * break
18341  *
18342  */
18343  __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
18344  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18345 
18346  /* "View.MemoryView":1134
18347  * if mslice.shape[i] > 1:
18348  * f_stride = mslice.strides[i]
18349  * break # <<<<<<<<<<<<<<
18350  *
18351  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18352  */
18353  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18354  goto __pyx_L7_break;
18355 
18356  /* "View.MemoryView":1132
18357  *
18358  * for i in range(ndim):
18359  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18360  * f_stride = mslice.strides[i]
18361  * break
18362  */
18363  }
18364  }
18365  __pyx_L7_break:;
18366 
18367  /* "View.MemoryView":1136
18368  * break
18369  *
18370  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18371  * return 'C'
18372  * else:
18373  */
18374  __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
18375  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18376  if (__pyx_t_2) {
18377 
18378  /* "View.MemoryView":1137
18379  *
18380  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18381  * return 'C' # <<<<<<<<<<<<<<
18382  * else:
18383  * return 'F'
18384  */
18385  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18386  __pyx_r = 'C';
18387  goto __pyx_L0;
18388 
18389  /* "View.MemoryView":1136
18390  * break
18391  *
18392  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18393  * return 'C'
18394  * else:
18395  */
18396  }
18397 
18398  /* "View.MemoryView":1139
18399  * return 'C'
18400  * else:
18401  * return 'F' # <<<<<<<<<<<<<<
18402  *
18403  * @cython.cdivision(True)
18404  */
18405  __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
18406  /*else*/ {
18407  __pyx_r = 'F';
18408  goto __pyx_L0;
18409  }
18410 
18411  /* "View.MemoryView":1118
18412  *
18413  * @cname('__pyx_get_best_slice_order')
18414  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18415  * """
18416  * Figure out the best memory access order for a given slice.
18417  */
18418 
18419  /* function exit code */
18420  __pyx_L1_error:;
18421  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18422  __pyx_r = 0;
18423  __pyx_L0:;
18424  __Pyx_TraceReturn(Py_None, 1);
18425  return __pyx_r;
18426 }
18427 
18428 /* "View.MemoryView":1142
18429  *
18430  * @cython.cdivision(True)
18431  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18432  * char *dst_data, Py_ssize_t *dst_strides,
18433  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18434  */
18435 
18436 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18437  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18438  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18439  Py_ssize_t __pyx_v_dst_extent;
18440  Py_ssize_t __pyx_v_src_stride;
18441  Py_ssize_t __pyx_v_dst_stride;
18442  int __pyx_t_1;
18443  int __pyx_t_2;
18444  int __pyx_t_3;
18445  Py_ssize_t __pyx_t_4;
18446  Py_ssize_t __pyx_t_5;
18447  Py_ssize_t __pyx_t_6;
18448 
18449  /* "View.MemoryView":1149
18450  *
18451  * cdef Py_ssize_t i
18452  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18453  * cdef Py_ssize_t dst_extent = dst_shape[0]
18454  * cdef Py_ssize_t src_stride = src_strides[0]
18455  */
18456  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18457 
18458  /* "View.MemoryView":1150
18459  * cdef Py_ssize_t i
18460  * cdef Py_ssize_t src_extent = src_shape[0]
18461  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18462  * cdef Py_ssize_t src_stride = src_strides[0]
18463  * cdef Py_ssize_t dst_stride = dst_strides[0]
18464  */
18465  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18466 
18467  /* "View.MemoryView":1151
18468  * cdef Py_ssize_t src_extent = src_shape[0]
18469  * cdef Py_ssize_t dst_extent = dst_shape[0]
18470  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18471  * cdef Py_ssize_t dst_stride = dst_strides[0]
18472  *
18473  */
18474  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18475 
18476  /* "View.MemoryView":1152
18477  * cdef Py_ssize_t dst_extent = dst_shape[0]
18478  * cdef Py_ssize_t src_stride = src_strides[0]
18479  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18480  *
18481  * if ndim == 1:
18482  */
18483  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18484 
18485  /* "View.MemoryView":1154
18486  * cdef Py_ssize_t dst_stride = dst_strides[0]
18487  *
18488  * if ndim == 1: # <<<<<<<<<<<<<<
18489  * if (src_stride > 0 and dst_stride > 0 and
18490  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18491  */
18492  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18493  if (__pyx_t_1) {
18494 
18495  /* "View.MemoryView":1155
18496  *
18497  * if ndim == 1:
18498  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18499  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18500  * memcpy(dst_data, src_data, itemsize * dst_extent)
18501  */
18502  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18503  if (__pyx_t_2) {
18504  } else {
18505  __pyx_t_1 = __pyx_t_2;
18506  goto __pyx_L5_bool_binop_done;
18507  }
18508  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18509  if (__pyx_t_2) {
18510  } else {
18511  __pyx_t_1 = __pyx_t_2;
18512  goto __pyx_L5_bool_binop_done;
18513  }
18514 
18515  /* "View.MemoryView":1156
18516  * if ndim == 1:
18517  * if (src_stride > 0 and dst_stride > 0 and
18518  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18519  * memcpy(dst_data, src_data, itemsize * dst_extent)
18520  * else:
18521  */
18522  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18523  if (__pyx_t_2) {
18524  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18525  }
18526  __pyx_t_3 = (__pyx_t_2 != 0);
18527  __pyx_t_1 = __pyx_t_3;
18528  __pyx_L5_bool_binop_done:;
18529 
18530  /* "View.MemoryView":1155
18531  *
18532  * if ndim == 1:
18533  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18534  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18535  * memcpy(dst_data, src_data, itemsize * dst_extent)
18536  */
18537  if (__pyx_t_1) {
18538 
18539  /* "View.MemoryView":1157
18540  * if (src_stride > 0 and dst_stride > 0 and
18541  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18542  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18543  * else:
18544  * for i in range(dst_extent):
18545  */
18546  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18547 
18548  /* "View.MemoryView":1155
18549  *
18550  * if ndim == 1:
18551  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18552  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18553  * memcpy(dst_data, src_data, itemsize * dst_extent)
18554  */
18555  goto __pyx_L4;
18556  }
18557 
18558  /* "View.MemoryView":1159
18559  * memcpy(dst_data, src_data, itemsize * dst_extent)
18560  * else:
18561  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18562  * memcpy(dst_data, src_data, itemsize)
18563  * src_data += src_stride
18564  */
18565  /*else*/ {
18566  __pyx_t_4 = __pyx_v_dst_extent;
18567  __pyx_t_5 = __pyx_t_4;
18568  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18569  __pyx_v_i = __pyx_t_6;
18570 
18571  /* "View.MemoryView":1160
18572  * else:
18573  * for i in range(dst_extent):
18574  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18575  * src_data += src_stride
18576  * dst_data += dst_stride
18577  */
18578  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18579 
18580  /* "View.MemoryView":1161
18581  * for i in range(dst_extent):
18582  * memcpy(dst_data, src_data, itemsize)
18583  * src_data += src_stride # <<<<<<<<<<<<<<
18584  * dst_data += dst_stride
18585  * else:
18586  */
18587  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18588 
18589  /* "View.MemoryView":1162
18590  * memcpy(dst_data, src_data, itemsize)
18591  * src_data += src_stride
18592  * dst_data += dst_stride # <<<<<<<<<<<<<<
18593  * else:
18594  * for i in range(dst_extent):
18595  */
18596  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18597  }
18598  }
18599  __pyx_L4:;
18600 
18601  /* "View.MemoryView":1154
18602  * cdef Py_ssize_t dst_stride = dst_strides[0]
18603  *
18604  * if ndim == 1: # <<<<<<<<<<<<<<
18605  * if (src_stride > 0 and dst_stride > 0 and
18606  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18607  */
18608  goto __pyx_L3;
18609  }
18610 
18611  /* "View.MemoryView":1164
18612  * dst_data += dst_stride
18613  * else:
18614  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18615  * _copy_strided_to_strided(src_data, src_strides + 1,
18616  * dst_data, dst_strides + 1,
18617  */
18618  /*else*/ {
18619  __pyx_t_4 = __pyx_v_dst_extent;
18620  __pyx_t_5 = __pyx_t_4;
18621  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18622  __pyx_v_i = __pyx_t_6;
18623 
18624  /* "View.MemoryView":1165
18625  * else:
18626  * for i in range(dst_extent):
18627  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18628  * dst_data, dst_strides + 1,
18629  * src_shape + 1, dst_shape + 1,
18630  */
18631  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18632 
18633  /* "View.MemoryView":1169
18634  * src_shape + 1, dst_shape + 1,
18635  * ndim - 1, itemsize)
18636  * src_data += src_stride # <<<<<<<<<<<<<<
18637  * dst_data += dst_stride
18638  *
18639  */
18640  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18641 
18642  /* "View.MemoryView":1170
18643  * ndim - 1, itemsize)
18644  * src_data += src_stride
18645  * dst_data += dst_stride # <<<<<<<<<<<<<<
18646  *
18647  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18648  */
18649  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18650  }
18651  }
18652  __pyx_L3:;
18653 
18654  /* "View.MemoryView":1142
18655  *
18656  * @cython.cdivision(True)
18657  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18658  * char *dst_data, Py_ssize_t *dst_strides,
18659  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18660  */
18661 
18662  /* function exit code */
18663 }
18664 
18665 /* "View.MemoryView":1172
18666  * dst_data += dst_stride
18667  *
18668  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18669  * __Pyx_memviewslice *dst,
18670  * int ndim, size_t itemsize) nogil:
18671  */
18672 
18673 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18674  __Pyx_TraceDeclarations
18675  int __pyx_lineno = 0;
18676  const char *__pyx_filename = NULL;
18677  int __pyx_clineno = 0;
18678  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
18679 
18680  /* "View.MemoryView":1175
18681  * __Pyx_memviewslice *dst,
18682  * int ndim, size_t itemsize) nogil:
18683  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18684  * src.shape, dst.shape, ndim, itemsize)
18685  *
18686  */
18687  __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
18688  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18689 
18690  /* "View.MemoryView":1172
18691  * dst_data += dst_stride
18692  *
18693  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18694  * __Pyx_memviewslice *dst,
18695  * int ndim, size_t itemsize) nogil:
18696  */
18697 
18698  /* function exit code */
18699  goto __pyx_L0;
18700  __pyx_L1_error:;
18701  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18702  __pyx_L0:;
18703  __Pyx_TraceReturn(Py_None, 1);
18704 }
18705 
18706 /* "View.MemoryView":1179
18707  *
18708  * @cname('__pyx_memoryview_slice_get_size')
18709  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18710  * "Return the size of the memory occupied by the slice in number of bytes"
18711  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18712  */
18713 
18714 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18715  Py_ssize_t __pyx_v_shape;
18716  Py_ssize_t __pyx_v_size;
18717  Py_ssize_t __pyx_r;
18718  __Pyx_TraceDeclarations
18719  Py_ssize_t __pyx_t_1;
18720  Py_ssize_t *__pyx_t_2;
18721  Py_ssize_t *__pyx_t_3;
18722  Py_ssize_t *__pyx_t_4;
18723  int __pyx_lineno = 0;
18724  const char *__pyx_filename = NULL;
18725  int __pyx_clineno = 0;
18726  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
18727 
18728  /* "View.MemoryView":1181
18729  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18730  * "Return the size of the memory occupied by the slice in number of bytes"
18731  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18732  *
18733  * for shape in src.shape[:ndim]:
18734  */
18735  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18736  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18737  __pyx_v_size = __pyx_t_1;
18738 
18739  /* "View.MemoryView":1183
18740  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18741  *
18742  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18743  * size *= shape
18744  *
18745  */
18746  __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
18747  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18748  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18749  __pyx_t_2 = __pyx_t_4;
18750  __pyx_v_shape = (__pyx_t_2[0]);
18751 
18752  /* "View.MemoryView":1184
18753  *
18754  * for shape in src.shape[:ndim]:
18755  * size *= shape # <<<<<<<<<<<<<<
18756  *
18757  * return size
18758  */
18759  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18760  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18761  }
18762 
18763  /* "View.MemoryView":1186
18764  * size *= shape
18765  *
18766  * return size # <<<<<<<<<<<<<<
18767  *
18768  * @cname('__pyx_fill_contig_strides_array')
18769  */
18770  __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
18771  __pyx_r = __pyx_v_size;
18772  goto __pyx_L0;
18773 
18774  /* "View.MemoryView":1179
18775  *
18776  * @cname('__pyx_memoryview_slice_get_size')
18777  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18778  * "Return the size of the memory occupied by the slice in number of bytes"
18779  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18780  */
18781 
18782  /* function exit code */
18783  __pyx_L1_error:;
18784  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18785  __pyx_r = 0;
18786  __pyx_L0:;
18787  __Pyx_TraceReturn(Py_None, 1);
18788  return __pyx_r;
18789 }
18790 
18791 /* "View.MemoryView":1189
18792  *
18793  * @cname('__pyx_fill_contig_strides_array')
18794  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18795  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18796  * int ndim, char order) nogil:
18797  */
18798 
18799 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18800  int __pyx_v_idx;
18801  Py_ssize_t __pyx_r;
18802  __Pyx_TraceDeclarations
18803  int __pyx_t_1;
18804  int __pyx_t_2;
18805  int __pyx_t_3;
18806  int __pyx_t_4;
18807  int __pyx_lineno = 0;
18808  const char *__pyx_filename = NULL;
18809  int __pyx_clineno = 0;
18810  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18811 
18812  /* "View.MemoryView":1198
18813  * cdef int idx
18814  *
18815  * if order == 'F': # <<<<<<<<<<<<<<
18816  * for idx in range(ndim):
18817  * strides[idx] = stride
18818  */
18819  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18820  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18821  if (__pyx_t_1) {
18822 
18823  /* "View.MemoryView":1199
18824  *
18825  * if order == 'F':
18826  * for idx in range(ndim): # <<<<<<<<<<<<<<
18827  * strides[idx] = stride
18828  * stride *= shape[idx]
18829  */
18830  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18831  __pyx_t_2 = __pyx_v_ndim;
18832  __pyx_t_3 = __pyx_t_2;
18833  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18834  __pyx_v_idx = __pyx_t_4;
18835 
18836  /* "View.MemoryView":1200
18837  * if order == 'F':
18838  * for idx in range(ndim):
18839  * strides[idx] = stride # <<<<<<<<<<<<<<
18840  * stride *= shape[idx]
18841  * else:
18842  */
18843  __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18844  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18845 
18846  /* "View.MemoryView":1201
18847  * for idx in range(ndim):
18848  * strides[idx] = stride
18849  * stride *= shape[idx] # <<<<<<<<<<<<<<
18850  * else:
18851  * for idx in range(ndim - 1, -1, -1):
18852  */
18853  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18854  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18855  }
18856 
18857  /* "View.MemoryView":1198
18858  * cdef int idx
18859  *
18860  * if order == 'F': # <<<<<<<<<<<<<<
18861  * for idx in range(ndim):
18862  * strides[idx] = stride
18863  */
18864  goto __pyx_L3;
18865  }
18866 
18867  /* "View.MemoryView":1203
18868  * stride *= shape[idx]
18869  * else:
18870  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18871  * strides[idx] = stride
18872  * stride *= shape[idx]
18873  */
18874  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18875  /*else*/ {
18876  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18877  __pyx_v_idx = __pyx_t_2;
18878 
18879  /* "View.MemoryView":1204
18880  * else:
18881  * for idx in range(ndim - 1, -1, -1):
18882  * strides[idx] = stride # <<<<<<<<<<<<<<
18883  * stride *= shape[idx]
18884  *
18885  */
18886  __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18887  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18888 
18889  /* "View.MemoryView":1205
18890  * for idx in range(ndim - 1, -1, -1):
18891  * strides[idx] = stride
18892  * stride *= shape[idx] # <<<<<<<<<<<<<<
18893  *
18894  * return stride
18895  */
18896  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18897  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18898  }
18899  }
18900  __pyx_L3:;
18901 
18902  /* "View.MemoryView":1207
18903  * stride *= shape[idx]
18904  *
18905  * return stride # <<<<<<<<<<<<<<
18906  *
18907  * @cname('__pyx_memoryview_copy_data_to_temp')
18908  */
18909  __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18910  __pyx_r = __pyx_v_stride;
18911  goto __pyx_L0;
18912 
18913  /* "View.MemoryView":1189
18914  *
18915  * @cname('__pyx_fill_contig_strides_array')
18916  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18917  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18918  * int ndim, char order) nogil:
18919  */
18920 
18921  /* function exit code */
18922  __pyx_L1_error:;
18923  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18924  __pyx_r = 0;
18925  __pyx_L0:;
18926  __Pyx_TraceReturn(Py_None, 1);
18927  return __pyx_r;
18928 }
18929 
18930 /* "View.MemoryView":1210
18931  *
18932  * @cname('__pyx_memoryview_copy_data_to_temp')
18933  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18934  * __Pyx_memviewslice *tmpslice,
18935  * char order,
18936  */
18937 
18938 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18939  int __pyx_v_i;
18940  void *__pyx_v_result;
18941  size_t __pyx_v_itemsize;
18942  size_t __pyx_v_size;
18943  void *__pyx_r;
18944  __Pyx_TraceDeclarations
18945  Py_ssize_t __pyx_t_1;
18946  int __pyx_t_2;
18947  int __pyx_t_3;
18948  struct __pyx_memoryview_obj *__pyx_t_4;
18949  int __pyx_t_5;
18950  int __pyx_t_6;
18951  int __pyx_lineno = 0;
18952  const char *__pyx_filename = NULL;
18953  int __pyx_clineno = 0;
18954  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18955 
18956  /* "View.MemoryView":1221
18957  * cdef void *result
18958  *
18959  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18960  * cdef size_t size = slice_get_size(src, ndim)
18961  *
18962  */
18963  __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18964  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18965  __pyx_v_itemsize = __pyx_t_1;
18966 
18967  /* "View.MemoryView":1222
18968  *
18969  * cdef size_t itemsize = src.memview.view.itemsize
18970  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18971  *
18972  * result = malloc(size)
18973  */
18974  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18975  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18976 
18977  /* "View.MemoryView":1224
18978  * cdef size_t size = slice_get_size(src, ndim)
18979  *
18980  * result = malloc(size) # <<<<<<<<<<<<<<
18981  * if not result:
18982  * _err(MemoryError, NULL)
18983  */
18984  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18985  __pyx_v_result = malloc(__pyx_v_size);
18986 
18987  /* "View.MemoryView":1225
18988  *
18989  * result = malloc(size)
18990  * if not result: # <<<<<<<<<<<<<<
18991  * _err(MemoryError, NULL)
18992  *
18993  */
18994  __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18995  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18996  if (__pyx_t_2) {
18997 
18998  /* "View.MemoryView":1226
18999  * result = malloc(size)
19000  * if not result:
19001  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19002  *
19003  *
19004  */
19005  __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
19006  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
19007 
19008  /* "View.MemoryView":1225
19009  *
19010  * result = malloc(size)
19011  * if not result: # <<<<<<<<<<<<<<
19012  * _err(MemoryError, NULL)
19013  *
19014  */
19015  }
19016 
19017  /* "View.MemoryView":1229
19018  *
19019  *
19020  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19021  * tmpslice.memview = src.memview
19022  * for i in range(ndim):
19023  */
19024  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
19025  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19026 
19027  /* "View.MemoryView":1230
19028  *
19029  * tmpslice.data = <char *> result
19030  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19031  * for i in range(ndim):
19032  * tmpslice.shape[i] = src.shape[i]
19033  */
19034  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
19035  __pyx_t_4 = __pyx_v_src->memview;
19036  __pyx_v_tmpslice->memview = __pyx_t_4;
19037 
19038  /* "View.MemoryView":1231
19039  * tmpslice.data = <char *> result
19040  * tmpslice.memview = src.memview
19041  * for i in range(ndim): # <<<<<<<<<<<<<<
19042  * tmpslice.shape[i] = src.shape[i]
19043  * tmpslice.suboffsets[i] = -1
19044  */
19045  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
19046  __pyx_t_3 = __pyx_v_ndim;
19047  __pyx_t_5 = __pyx_t_3;
19048  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19049  __pyx_v_i = __pyx_t_6;
19050 
19051  /* "View.MemoryView":1232
19052  * tmpslice.memview = src.memview
19053  * for i in range(ndim):
19054  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19055  * tmpslice.suboffsets[i] = -1
19056  *
19057  */
19058  __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
19059  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19060 
19061  /* "View.MemoryView":1233
19062  * for i in range(ndim):
19063  * tmpslice.shape[i] = src.shape[i]
19064  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19065  *
19066  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19067  */
19068  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
19069  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19070  }
19071 
19072  /* "View.MemoryView":1235
19073  * tmpslice.suboffsets[i] = -1
19074  *
19075  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19076  * ndim, order)
19077  *
19078  */
19079  __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
19080  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19081 
19082  /* "View.MemoryView":1239
19083  *
19084  *
19085  * for i in range(ndim): # <<<<<<<<<<<<<<
19086  * if tmpslice.shape[i] == 1:
19087  * tmpslice.strides[i] = 0
19088  */
19089  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
19090  __pyx_t_3 = __pyx_v_ndim;
19091  __pyx_t_5 = __pyx_t_3;
19092  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19093  __pyx_v_i = __pyx_t_6;
19094 
19095  /* "View.MemoryView":1240
19096  *
19097  * for i in range(ndim):
19098  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19099  * tmpslice.strides[i] = 0
19100  *
19101  */
19102  __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
19103  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19104  if (__pyx_t_2) {
19105 
19106  /* "View.MemoryView":1241
19107  * for i in range(ndim):
19108  * if tmpslice.shape[i] == 1:
19109  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19110  *
19111  * if slice_is_contig(src[0], order, ndim):
19112  */
19113  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
19114  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19115 
19116  /* "View.MemoryView":1240
19117  *
19118  * for i in range(ndim):
19119  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19120  * tmpslice.strides[i] = 0
19121  *
19122  */
19123  }
19124  }
19125 
19126  /* "View.MemoryView":1243
19127  * tmpslice.strides[i] = 0
19128  *
19129  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19130  * memcpy(result, src.data, size)
19131  * else:
19132  */
19133  __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
19134  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19135  if (__pyx_t_2) {
19136 
19137  /* "View.MemoryView":1244
19138  *
19139  * if slice_is_contig(src[0], order, ndim):
19140  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19141  * else:
19142  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19143  */
19144  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
19145  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19146 
19147  /* "View.MemoryView":1243
19148  * tmpslice.strides[i] = 0
19149  *
19150  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19151  * memcpy(result, src.data, size)
19152  * else:
19153  */
19154  goto __pyx_L9;
19155  }
19156 
19157  /* "View.MemoryView":1246
19158  * memcpy(result, src.data, size)
19159  * else:
19160  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19161  *
19162  * return result
19163  */
19164  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
19165  /*else*/ {
19166  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19167  }
19168  __pyx_L9:;
19169 
19170  /* "View.MemoryView":1248
19171  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19172  *
19173  * return result # <<<<<<<<<<<<<<
19174  *
19175  *
19176  */
19177  __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
19178  __pyx_r = __pyx_v_result;
19179  goto __pyx_L0;
19180 
19181  /* "View.MemoryView":1210
19182  *
19183  * @cname('__pyx_memoryview_copy_data_to_temp')
19184  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19185  * __Pyx_memviewslice *tmpslice,
19186  * char order,
19187  */
19188 
19189  /* function exit code */
19190  __pyx_L1_error:;
19191  {
19192  #ifdef WITH_THREAD
19193  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19194  #endif
19195  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19196  #ifdef WITH_THREAD
19197  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19198  #endif
19199  }
19200  __pyx_r = NULL;
19201  __pyx_L0:;
19202  __Pyx_TraceReturn(Py_None, 1);
19203  return __pyx_r;
19204 }
19205 
19206 /* "View.MemoryView":1253
19207  *
19208  * @cname('__pyx_memoryview_err_extents')
19209  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19210  * Py_ssize_t extent2) except -1 with gil:
19211  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19212  */
19213 
19214 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19215  int __pyx_r;
19216  __Pyx_TraceDeclarations
19217  __Pyx_RefNannyDeclarations
19218  PyObject *__pyx_t_1 = NULL;
19219  PyObject *__pyx_t_2 = NULL;
19220  PyObject *__pyx_t_3 = NULL;
19221  PyObject *__pyx_t_4 = NULL;
19222  int __pyx_lineno = 0;
19223  const char *__pyx_filename = NULL;
19224  int __pyx_clineno = 0;
19225  #ifdef WITH_THREAD
19226  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19227  #endif
19228  __Pyx_RefNannySetupContext("_err_extents", 0);
19229  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
19230 
19231  /* "View.MemoryView":1256
19232  * Py_ssize_t extent2) except -1 with gil:
19233  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19234  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19235  *
19236  * @cname('__pyx_memoryview_err_dim')
19237  */
19238  __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
19239  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
19240  __Pyx_GOTREF(__pyx_t_1);
19241  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
19242  __Pyx_GOTREF(__pyx_t_2);
19243  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
19244  __Pyx_GOTREF(__pyx_t_3);
19245  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
19246  __Pyx_GOTREF(__pyx_t_4);
19247  __Pyx_GIVEREF(__pyx_t_1);
19248  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19249  __Pyx_GIVEREF(__pyx_t_2);
19250  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19251  __Pyx_GIVEREF(__pyx_t_3);
19252  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19253  __pyx_t_1 = 0;
19254  __pyx_t_2 = 0;
19255  __pyx_t_3 = 0;
19256 
19257  /* "View.MemoryView":1255
19258  * cdef int _err_extents(int i, Py_ssize_t extent1,
19259  * Py_ssize_t extent2) except -1 with gil:
19260  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19261  * (i, extent1, extent2))
19262  *
19263  */
19264  __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
19265  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
19266  __Pyx_GOTREF(__pyx_t_3);
19267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19268  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
19269  __Pyx_GOTREF(__pyx_t_4);
19270  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19271  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19272  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19273  __PYX_ERR(1, 1255, __pyx_L1_error)
19274 
19275  /* "View.MemoryView":1253
19276  *
19277  * @cname('__pyx_memoryview_err_extents')
19278  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19279  * Py_ssize_t extent2) except -1 with gil:
19280  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19281  */
19282 
19283  /* function exit code */
19284  __pyx_L1_error:;
19285  __Pyx_XDECREF(__pyx_t_1);
19286  __Pyx_XDECREF(__pyx_t_2);
19287  __Pyx_XDECREF(__pyx_t_3);
19288  __Pyx_XDECREF(__pyx_t_4);
19289  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19290  __pyx_r = -1;
19291  __Pyx_TraceReturn(Py_None, 0);
19292  __Pyx_RefNannyFinishContext();
19293  #ifdef WITH_THREAD
19294  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19295  #endif
19296  return __pyx_r;
19297 }
19298 
19299 /* "View.MemoryView":1259
19300  *
19301  * @cname('__pyx_memoryview_err_dim')
19302  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19303  * raise error(msg.decode('ascii') % dim)
19304  *
19305  */
19306 
19307 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19308  int __pyx_r;
19309  __Pyx_TraceDeclarations
19310  __Pyx_RefNannyDeclarations
19311  PyObject *__pyx_t_1 = NULL;
19312  PyObject *__pyx_t_2 = NULL;
19313  PyObject *__pyx_t_3 = NULL;
19314  PyObject *__pyx_t_4 = NULL;
19315  int __pyx_lineno = 0;
19316  const char *__pyx_filename = NULL;
19317  int __pyx_clineno = 0;
19318  #ifdef WITH_THREAD
19319  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19320  #endif
19321  __Pyx_RefNannySetupContext("_err_dim", 0);
19322  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
19323  __Pyx_INCREF(__pyx_v_error);
19324 
19325  /* "View.MemoryView":1260
19326  * @cname('__pyx_memoryview_err_dim')
19327  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19328  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19329  *
19330  * @cname('__pyx_memoryview_err')
19331  */
19332  __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
19333  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
19334  __Pyx_GOTREF(__pyx_t_2);
19335  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
19336  __Pyx_GOTREF(__pyx_t_3);
19337  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
19338  __Pyx_GOTREF(__pyx_t_4);
19339  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19340  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19341  __Pyx_INCREF(__pyx_v_error);
19342  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19343  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19344  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19345  if (likely(__pyx_t_2)) {
19346  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19347  __Pyx_INCREF(__pyx_t_2);
19348  __Pyx_INCREF(function);
19349  __Pyx_DECREF_SET(__pyx_t_3, function);
19350  }
19351  }
19352  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19353  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19354  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19355  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
19356  __Pyx_GOTREF(__pyx_t_1);
19357  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19358  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19359  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19360  __PYX_ERR(1, 1260, __pyx_L1_error)
19361 
19362  /* "View.MemoryView":1259
19363  *
19364  * @cname('__pyx_memoryview_err_dim')
19365  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19366  * raise error(msg.decode('ascii') % dim)
19367  *
19368  */
19369 
19370  /* function exit code */
19371  __pyx_L1_error:;
19372  __Pyx_XDECREF(__pyx_t_1);
19373  __Pyx_XDECREF(__pyx_t_2);
19374  __Pyx_XDECREF(__pyx_t_3);
19375  __Pyx_XDECREF(__pyx_t_4);
19376  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19377  __pyx_r = -1;
19378  __Pyx_XDECREF(__pyx_v_error);
19379  __Pyx_TraceReturn(Py_None, 0);
19380  __Pyx_RefNannyFinishContext();
19381  #ifdef WITH_THREAD
19382  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19383  #endif
19384  return __pyx_r;
19385 }
19386 
19387 /* "View.MemoryView":1263
19388  *
19389  * @cname('__pyx_memoryview_err')
19390  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19391  * if msg != NULL:
19392  * raise error(msg.decode('ascii'))
19393  */
19394 
19395 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19396  int __pyx_r;
19397  __Pyx_TraceDeclarations
19398  __Pyx_RefNannyDeclarations
19399  int __pyx_t_1;
19400  PyObject *__pyx_t_2 = NULL;
19401  PyObject *__pyx_t_3 = NULL;
19402  PyObject *__pyx_t_4 = NULL;
19403  PyObject *__pyx_t_5 = NULL;
19404  int __pyx_lineno = 0;
19405  const char *__pyx_filename = NULL;
19406  int __pyx_clineno = 0;
19407  #ifdef WITH_THREAD
19408  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19409  #endif
19410  __Pyx_RefNannySetupContext("_err", 0);
19411  __Pyx_TraceCall("_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
19412  __Pyx_INCREF(__pyx_v_error);
19413 
19414  /* "View.MemoryView":1264
19415  * @cname('__pyx_memoryview_err')
19416  * cdef int _err(object error, char *msg) except -1 with gil:
19417  * if msg != NULL: # <<<<<<<<<<<<<<
19418  * raise error(msg.decode('ascii'))
19419  * else:
19420  */
19421  __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
19422  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19423  if (unlikely(__pyx_t_1)) {
19424 
19425  /* "View.MemoryView":1265
19426  * cdef int _err(object error, char *msg) except -1 with gil:
19427  * if msg != NULL:
19428  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19429  * else:
19430  * raise error
19431  */
19432  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19433  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
19434  __Pyx_GOTREF(__pyx_t_3);
19435  __Pyx_INCREF(__pyx_v_error);
19436  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19437  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19438  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19439  if (likely(__pyx_t_5)) {
19440  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19441  __Pyx_INCREF(__pyx_t_5);
19442  __Pyx_INCREF(function);
19443  __Pyx_DECREF_SET(__pyx_t_4, function);
19444  }
19445  }
19446  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19447  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19448  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19449  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
19450  __Pyx_GOTREF(__pyx_t_2);
19451  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19452  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19453  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19454  __PYX_ERR(1, 1265, __pyx_L1_error)
19455 
19456  /* "View.MemoryView":1264
19457  * @cname('__pyx_memoryview_err')
19458  * cdef int _err(object error, char *msg) except -1 with gil:
19459  * if msg != NULL: # <<<<<<<<<<<<<<
19460  * raise error(msg.decode('ascii'))
19461  * else:
19462  */
19463  }
19464 
19465  /* "View.MemoryView":1267
19466  * raise error(msg.decode('ascii'))
19467  * else:
19468  * raise error # <<<<<<<<<<<<<<
19469  *
19470  * @cname('__pyx_memoryview_copy_contents')
19471  */
19472  __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
19473  /*else*/ {
19474  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19475  __PYX_ERR(1, 1267, __pyx_L1_error)
19476  }
19477 
19478  /* "View.MemoryView":1263
19479  *
19480  * @cname('__pyx_memoryview_err')
19481  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19482  * if msg != NULL:
19483  * raise error(msg.decode('ascii'))
19484  */
19485 
19486  /* function exit code */
19487  __pyx_L1_error:;
19488  __Pyx_XDECREF(__pyx_t_2);
19489  __Pyx_XDECREF(__pyx_t_3);
19490  __Pyx_XDECREF(__pyx_t_4);
19491  __Pyx_XDECREF(__pyx_t_5);
19492  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19493  __pyx_r = -1;
19494  __Pyx_XDECREF(__pyx_v_error);
19495  __Pyx_TraceReturn(Py_None, 0);
19496  __Pyx_RefNannyFinishContext();
19497  #ifdef WITH_THREAD
19498  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19499  #endif
19500  return __pyx_r;
19501 }
19502 
19503 /* "View.MemoryView":1270
19504  *
19505  * @cname('__pyx_memoryview_copy_contents')
19506  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19507  * __Pyx_memviewslice dst,
19508  * int src_ndim, int dst_ndim,
19509  */
19510 
19511 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19512  void *__pyx_v_tmpdata;
19513  size_t __pyx_v_itemsize;
19514  int __pyx_v_i;
19515  char __pyx_v_order;
19516  int __pyx_v_broadcasting;
19517  int __pyx_v_direct_copy;
19518  __Pyx_memviewslice __pyx_v_tmp;
19519  int __pyx_v_ndim;
19520  int __pyx_r;
19521  __Pyx_TraceDeclarations
19522  Py_ssize_t __pyx_t_1;
19523  int __pyx_t_2;
19524  int __pyx_t_3;
19525  int __pyx_t_4;
19526  int __pyx_t_5;
19527  int __pyx_t_6;
19528  void *__pyx_t_7;
19529  int __pyx_t_8;
19530  int __pyx_lineno = 0;
19531  const char *__pyx_filename = NULL;
19532  int __pyx_clineno = 0;
19533  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
19534 
19535  /* "View.MemoryView":1278
19536  * Check for overlapping memory and verify the shapes.
19537  * """
19538  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19539  * cdef size_t itemsize = src.memview.view.itemsize
19540  * cdef int i
19541  */
19542  __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
19543  __pyx_v_tmpdata = NULL;
19544 
19545  /* "View.MemoryView":1279
19546  * """
19547  * cdef void *tmpdata = NULL
19548  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19549  * cdef int i
19550  * cdef char order = get_best_order(&src, src_ndim)
19551  */
19552  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19553  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19554  __pyx_v_itemsize = __pyx_t_1;
19555 
19556  /* "View.MemoryView":1281
19557  * cdef size_t itemsize = src.memview.view.itemsize
19558  * cdef int i
19559  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19560  * cdef bint broadcasting = False
19561  * cdef bint direct_copy = False
19562  */
19563  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19564  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19565 
19566  /* "View.MemoryView":1282
19567  * cdef int i
19568  * cdef char order = get_best_order(&src, src_ndim)
19569  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19570  * cdef bint direct_copy = False
19571  * cdef __Pyx_memviewslice tmp
19572  */
19573  __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
19574  __pyx_v_broadcasting = 0;
19575 
19576  /* "View.MemoryView":1283
19577  * cdef char order = get_best_order(&src, src_ndim)
19578  * cdef bint broadcasting = False
19579  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19580  * cdef __Pyx_memviewslice tmp
19581  *
19582  */
19583  __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
19584  __pyx_v_direct_copy = 0;
19585 
19586  /* "View.MemoryView":1286
19587  * cdef __Pyx_memviewslice tmp
19588  *
19589  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19590  * broadcast_leading(&src, src_ndim, dst_ndim)
19591  * elif dst_ndim < src_ndim:
19592  */
19593  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19594  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19595  if (__pyx_t_2) {
19596 
19597  /* "View.MemoryView":1287
19598  *
19599  * if src_ndim < dst_ndim:
19600  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19601  * elif dst_ndim < src_ndim:
19602  * broadcast_leading(&dst, dst_ndim, src_ndim)
19603  */
19604  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19605  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19606 
19607  /* "View.MemoryView":1286
19608  * cdef __Pyx_memviewslice tmp
19609  *
19610  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19611  * broadcast_leading(&src, src_ndim, dst_ndim)
19612  * elif dst_ndim < src_ndim:
19613  */
19614  goto __pyx_L3;
19615  }
19616 
19617  /* "View.MemoryView":1288
19618  * if src_ndim < dst_ndim:
19619  * broadcast_leading(&src, src_ndim, dst_ndim)
19620  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19621  * broadcast_leading(&dst, dst_ndim, src_ndim)
19622  *
19623  */
19624  __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
19625  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19626  if (__pyx_t_2) {
19627 
19628  /* "View.MemoryView":1289
19629  * broadcast_leading(&src, src_ndim, dst_ndim)
19630  * elif dst_ndim < src_ndim:
19631  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19632  *
19633  * cdef int ndim = max(src_ndim, dst_ndim)
19634  */
19635  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19636  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19637 
19638  /* "View.MemoryView":1288
19639  * if src_ndim < dst_ndim:
19640  * broadcast_leading(&src, src_ndim, dst_ndim)
19641  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19642  * broadcast_leading(&dst, dst_ndim, src_ndim)
19643  *
19644  */
19645  }
19646  __pyx_L3:;
19647 
19648  /* "View.MemoryView":1291
19649  * broadcast_leading(&dst, dst_ndim, src_ndim)
19650  *
19651  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19652  *
19653  * for i in range(ndim):
19654  */
19655  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19656  __pyx_t_3 = __pyx_v_dst_ndim;
19657  __pyx_t_4 = __pyx_v_src_ndim;
19658  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19659  __pyx_t_5 = __pyx_t_3;
19660  } else {
19661  __pyx_t_5 = __pyx_t_4;
19662  }
19663  __pyx_v_ndim = __pyx_t_5;
19664 
19665  /* "View.MemoryView":1293
19666  * cdef int ndim = max(src_ndim, dst_ndim)
19667  *
19668  * for i in range(ndim): # <<<<<<<<<<<<<<
19669  * if src.shape[i] != dst.shape[i]:
19670  * if src.shape[i] == 1:
19671  */
19672  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19673  __pyx_t_5 = __pyx_v_ndim;
19674  __pyx_t_3 = __pyx_t_5;
19675  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19676  __pyx_v_i = __pyx_t_4;
19677 
19678  /* "View.MemoryView":1294
19679  *
19680  * for i in range(ndim):
19681  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19682  * if src.shape[i] == 1:
19683  * broadcasting = True
19684  */
19685  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19686  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19687  if (__pyx_t_2) {
19688 
19689  /* "View.MemoryView":1295
19690  * for i in range(ndim):
19691  * if src.shape[i] != dst.shape[i]:
19692  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19693  * broadcasting = True
19694  * src.strides[i] = 0
19695  */
19696  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19697  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19698  if (__pyx_t_2) {
19699 
19700  /* "View.MemoryView":1296
19701  * if src.shape[i] != dst.shape[i]:
19702  * if src.shape[i] == 1:
19703  * broadcasting = True # <<<<<<<<<<<<<<
19704  * src.strides[i] = 0
19705  * else:
19706  */
19707  __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
19708  __pyx_v_broadcasting = 1;
19709 
19710  /* "View.MemoryView":1297
19711  * if src.shape[i] == 1:
19712  * broadcasting = True
19713  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19714  * else:
19715  * _err_extents(i, dst.shape[i], src.shape[i])
19716  */
19717  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19718  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19719 
19720  /* "View.MemoryView":1295
19721  * for i in range(ndim):
19722  * if src.shape[i] != dst.shape[i]:
19723  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19724  * broadcasting = True
19725  * src.strides[i] = 0
19726  */
19727  goto __pyx_L7;
19728  }
19729 
19730  /* "View.MemoryView":1299
19731  * src.strides[i] = 0
19732  * else:
19733  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19734  *
19735  * if src.suboffsets[i] >= 0:
19736  */
19737  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19738  /*else*/ {
19739  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
19740  }
19741  __pyx_L7:;
19742 
19743  /* "View.MemoryView":1294
19744  *
19745  * for i in range(ndim):
19746  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19747  * if src.shape[i] == 1:
19748  * broadcasting = True
19749  */
19750  }
19751 
19752  /* "View.MemoryView":1301
19753  * _err_extents(i, dst.shape[i], src.shape[i])
19754  *
19755  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19756  * _err_dim(ValueError, "Dimension %d is not direct", i)
19757  *
19758  */
19759  __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
19760  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19761  if (__pyx_t_2) {
19762 
19763  /* "View.MemoryView":1302
19764  *
19765  * if src.suboffsets[i] >= 0:
19766  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19767  *
19768  * if slices_overlap(&src, &dst, ndim, itemsize):
19769  */
19770  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19771  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19772 
19773  /* "View.MemoryView":1301
19774  * _err_extents(i, dst.shape[i], src.shape[i])
19775  *
19776  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19777  * _err_dim(ValueError, "Dimension %d is not direct", i)
19778  *
19779  */
19780  }
19781  }
19782 
19783  /* "View.MemoryView":1304
19784  * _err_dim(ValueError, "Dimension %d is not direct", i)
19785  *
19786  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19787  *
19788  * if not slice_is_contig(src, order, ndim):
19789  */
19790  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19791  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19792  if (__pyx_t_2) {
19793 
19794  /* "View.MemoryView":1306
19795  * if slices_overlap(&src, &dst, ndim, itemsize):
19796  *
19797  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19798  * order = get_best_order(&dst, ndim)
19799  *
19800  */
19801  __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19802  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19803  if (__pyx_t_2) {
19804 
19805  /* "View.MemoryView":1307
19806  *
19807  * if not slice_is_contig(src, order, ndim):
19808  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19809  *
19810  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19811  */
19812  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19813  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19814 
19815  /* "View.MemoryView":1306
19816  * if slices_overlap(&src, &dst, ndim, itemsize):
19817  *
19818  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19819  * order = get_best_order(&dst, ndim)
19820  *
19821  */
19822  }
19823 
19824  /* "View.MemoryView":1309
19825  * order = get_best_order(&dst, ndim)
19826  *
19827  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19828  * src = tmp
19829  *
19830  */
19831  __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19832  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19833  __pyx_v_tmpdata = __pyx_t_7;
19834 
19835  /* "View.MemoryView":1310
19836  *
19837  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19838  * src = tmp # <<<<<<<<<<<<<<
19839  *
19840  * if not broadcasting:
19841  */
19842  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19843  __pyx_v_src = __pyx_v_tmp;
19844 
19845  /* "View.MemoryView":1304
19846  * _err_dim(ValueError, "Dimension %d is not direct", i)
19847  *
19848  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19849  *
19850  * if not slice_is_contig(src, order, ndim):
19851  */
19852  }
19853 
19854  /* "View.MemoryView":1312
19855  * src = tmp
19856  *
19857  * if not broadcasting: # <<<<<<<<<<<<<<
19858  *
19859  *
19860  */
19861  __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19862  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19863  if (__pyx_t_2) {
19864 
19865  /* "View.MemoryView":1315
19866  *
19867  *
19868  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19869  * direct_copy = slice_is_contig(dst, 'C', ndim)
19870  * elif slice_is_contig(src, 'F', ndim):
19871  */
19872  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19873  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19874  if (__pyx_t_2) {
19875 
19876  /* "View.MemoryView":1316
19877  *
19878  * if slice_is_contig(src, 'C', ndim):
19879  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19880  * elif slice_is_contig(src, 'F', ndim):
19881  * direct_copy = slice_is_contig(dst, 'F', ndim)
19882  */
19883  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19884  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19885 
19886  /* "View.MemoryView":1315
19887  *
19888  *
19889  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19890  * direct_copy = slice_is_contig(dst, 'C', ndim)
19891  * elif slice_is_contig(src, 'F', ndim):
19892  */
19893  goto __pyx_L12;
19894  }
19895 
19896  /* "View.MemoryView":1317
19897  * if slice_is_contig(src, 'C', ndim):
19898  * direct_copy = slice_is_contig(dst, 'C', ndim)
19899  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19900  * direct_copy = slice_is_contig(dst, 'F', ndim)
19901  *
19902  */
19903  __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19904  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19905  if (__pyx_t_2) {
19906 
19907  /* "View.MemoryView":1318
19908  * direct_copy = slice_is_contig(dst, 'C', ndim)
19909  * elif slice_is_contig(src, 'F', ndim):
19910  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19911  *
19912  * if direct_copy:
19913  */
19914  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19915  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19916 
19917  /* "View.MemoryView":1317
19918  * if slice_is_contig(src, 'C', ndim):
19919  * direct_copy = slice_is_contig(dst, 'C', ndim)
19920  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19921  * direct_copy = slice_is_contig(dst, 'F', ndim)
19922  *
19923  */
19924  }
19925  __pyx_L12:;
19926 
19927  /* "View.MemoryView":1320
19928  * direct_copy = slice_is_contig(dst, 'F', ndim)
19929  *
19930  * if direct_copy: # <<<<<<<<<<<<<<
19931  *
19932  * refcount_copying(&dst, dtype_is_object, ndim, False)
19933  */
19934  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19935  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19936  if (__pyx_t_2) {
19937 
19938  /* "View.MemoryView":1322
19939  * if direct_copy:
19940  *
19941  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19942  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19943  * refcount_copying(&dst, dtype_is_object, ndim, True)
19944  */
19945  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19946  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19947 
19948  /* "View.MemoryView":1323
19949  *
19950  * refcount_copying(&dst, dtype_is_object, ndim, False)
19951  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19952  * refcount_copying(&dst, dtype_is_object, ndim, True)
19953  * free(tmpdata)
19954  */
19955  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19956  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19957 
19958  /* "View.MemoryView":1324
19959  * refcount_copying(&dst, dtype_is_object, ndim, False)
19960  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19961  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19962  * free(tmpdata)
19963  * return 0
19964  */
19965  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19966  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19967 
19968  /* "View.MemoryView":1325
19969  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19970  * refcount_copying(&dst, dtype_is_object, ndim, True)
19971  * free(tmpdata) # <<<<<<<<<<<<<<
19972  * return 0
19973  *
19974  */
19975  __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19976  free(__pyx_v_tmpdata);
19977 
19978  /* "View.MemoryView":1326
19979  * refcount_copying(&dst, dtype_is_object, ndim, True)
19980  * free(tmpdata)
19981  * return 0 # <<<<<<<<<<<<<<
19982  *
19983  * if order == 'F' == get_best_order(&dst, ndim):
19984  */
19985  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19986  __pyx_r = 0;
19987  goto __pyx_L0;
19988 
19989  /* "View.MemoryView":1320
19990  * direct_copy = slice_is_contig(dst, 'F', ndim)
19991  *
19992  * if direct_copy: # <<<<<<<<<<<<<<
19993  *
19994  * refcount_copying(&dst, dtype_is_object, ndim, False)
19995  */
19996  }
19997 
19998  /* "View.MemoryView":1312
19999  * src = tmp
20000  *
20001  * if not broadcasting: # <<<<<<<<<<<<<<
20002  *
20003  *
20004  */
20005  }
20006 
20007  /* "View.MemoryView":1328
20008  * return 0
20009  *
20010  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20011  *
20012  *
20013  */
20014  __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
20015  __pyx_t_2 = (__pyx_v_order == 'F');
20016  if (__pyx_t_2) {
20017  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20018  }
20019  __pyx_t_8 = (__pyx_t_2 != 0);
20020  if (__pyx_t_8) {
20021 
20022  /* "View.MemoryView":1331
20023  *
20024  *
20025  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20026  * transpose_memslice(&dst)
20027  *
20028  */
20029  __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
20030  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
20031 
20032  /* "View.MemoryView":1332
20033  *
20034  * transpose_memslice(&src)
20035  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20036  *
20037  * refcount_copying(&dst, dtype_is_object, ndim, False)
20038  */
20039  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
20040  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
20041 
20042  /* "View.MemoryView":1328
20043  * return 0
20044  *
20045  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20046  *
20047  *
20048  */
20049  }
20050 
20051  /* "View.MemoryView":1334
20052  * transpose_memslice(&dst)
20053  *
20054  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20055  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20056  * refcount_copying(&dst, dtype_is_object, ndim, True)
20057  */
20058  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
20059  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20060 
20061  /* "View.MemoryView":1335
20062  *
20063  * refcount_copying(&dst, dtype_is_object, ndim, False)
20064  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20065  * refcount_copying(&dst, dtype_is_object, ndim, True)
20066  *
20067  */
20068  __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
20069  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20070 
20071  /* "View.MemoryView":1336
20072  * refcount_copying(&dst, dtype_is_object, ndim, False)
20073  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20074  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20075  *
20076  * free(tmpdata)
20077  */
20078  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
20079  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20080 
20081  /* "View.MemoryView":1338
20082  * refcount_copying(&dst, dtype_is_object, ndim, True)
20083  *
20084  * free(tmpdata) # <<<<<<<<<<<<<<
20085  * return 0
20086  *
20087  */
20088  __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
20089  free(__pyx_v_tmpdata);
20090 
20091  /* "View.MemoryView":1339
20092  *
20093  * free(tmpdata)
20094  * return 0 # <<<<<<<<<<<<<<
20095  *
20096  * @cname('__pyx_memoryview_broadcast_leading')
20097  */
20098  __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
20099  __pyx_r = 0;
20100  goto __pyx_L0;
20101 
20102  /* "View.MemoryView":1270
20103  *
20104  * @cname('__pyx_memoryview_copy_contents')
20105  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20106  * __Pyx_memviewslice dst,
20107  * int src_ndim, int dst_ndim,
20108  */
20109 
20110  /* function exit code */
20111  __pyx_L1_error:;
20112  {
20113  #ifdef WITH_THREAD
20114  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20115  #endif
20116  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20117  #ifdef WITH_THREAD
20118  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20119  #endif
20120  }
20121  __pyx_r = -1;
20122  __pyx_L0:;
20123  __Pyx_TraceReturn(Py_None, 1);
20124  return __pyx_r;
20125 }
20126 
20127 /* "View.MemoryView":1342
20128  *
20129  * @cname('__pyx_memoryview_broadcast_leading')
20130  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20131  * int ndim,
20132  * int ndim_other) nogil:
20133  */
20134 
20135 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20136  int __pyx_v_i;
20137  int __pyx_v_offset;
20138  __Pyx_TraceDeclarations
20139  int __pyx_t_1;
20140  int __pyx_t_2;
20141  int __pyx_t_3;
20142  int __pyx_lineno = 0;
20143  const char *__pyx_filename = NULL;
20144  int __pyx_clineno = 0;
20145  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
20146 
20147  /* "View.MemoryView":1346
20148  * int ndim_other) nogil:
20149  * cdef int i
20150  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20151  *
20152  * for i in range(ndim - 1, -1, -1):
20153  */
20154  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
20155  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20156 
20157  /* "View.MemoryView":1348
20158  * cdef int offset = ndim_other - ndim
20159  *
20160  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20161  * mslice.shape[i + offset] = mslice.shape[i]
20162  * mslice.strides[i + offset] = mslice.strides[i]
20163  */
20164  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
20165  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20166  __pyx_v_i = __pyx_t_1;
20167 
20168  /* "View.MemoryView":1349
20169  *
20170  * for i in range(ndim - 1, -1, -1):
20171  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20172  * mslice.strides[i + offset] = mslice.strides[i]
20173  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20174  */
20175  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
20176  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20177 
20178  /* "View.MemoryView":1350
20179  * for i in range(ndim - 1, -1, -1):
20180  * mslice.shape[i + offset] = mslice.shape[i]
20181  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20182  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20183  *
20184  */
20185  __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
20186  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20187 
20188  /* "View.MemoryView":1351
20189  * mslice.shape[i + offset] = mslice.shape[i]
20190  * mslice.strides[i + offset] = mslice.strides[i]
20191  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20192  *
20193  * for i in range(offset):
20194  */
20195  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
20196  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20197  }
20198 
20199  /* "View.MemoryView":1353
20200  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20201  *
20202  * for i in range(offset): # <<<<<<<<<<<<<<
20203  * mslice.shape[i] = 1
20204  * mslice.strides[i] = mslice.strides[0]
20205  */
20206  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
20207  __pyx_t_1 = __pyx_v_offset;
20208  __pyx_t_2 = __pyx_t_1;
20209  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20210  __pyx_v_i = __pyx_t_3;
20211 
20212  /* "View.MemoryView":1354
20213  *
20214  * for i in range(offset):
20215  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20216  * mslice.strides[i] = mslice.strides[0]
20217  * mslice.suboffsets[i] = -1
20218  */
20219  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
20220  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20221 
20222  /* "View.MemoryView":1355
20223  * for i in range(offset):
20224  * mslice.shape[i] = 1
20225  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20226  * mslice.suboffsets[i] = -1
20227  *
20228  */
20229  __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
20230  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20231 
20232  /* "View.MemoryView":1356
20233  * mslice.shape[i] = 1
20234  * mslice.strides[i] = mslice.strides[0]
20235  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20236  *
20237  *
20238  */
20239  __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
20240  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20241  }
20242 
20243  /* "View.MemoryView":1342
20244  *
20245  * @cname('__pyx_memoryview_broadcast_leading')
20246  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20247  * int ndim,
20248  * int ndim_other) nogil:
20249  */
20250 
20251  /* function exit code */
20252  goto __pyx_L0;
20253  __pyx_L1_error:;
20254  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20255  __pyx_L0:;
20256  __Pyx_TraceReturn(Py_None, 1);
20257 }
20258 
20259 /* "View.MemoryView":1364
20260  *
20261  * @cname('__pyx_memoryview_refcount_copying')
20262  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20263  * int ndim, bint inc) nogil:
20264  *
20265  */
20266 
20267 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20268  __Pyx_TraceDeclarations
20269  int __pyx_t_1;
20270  int __pyx_lineno = 0;
20271  const char *__pyx_filename = NULL;
20272  int __pyx_clineno = 0;
20273  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
20274 
20275  /* "View.MemoryView":1368
20276  *
20277  *
20278  * if dtype_is_object: # <<<<<<<<<<<<<<
20279  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20280  * dst.strides, ndim, inc)
20281  */
20282  __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
20283  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20284  if (__pyx_t_1) {
20285 
20286  /* "View.MemoryView":1369
20287  *
20288  * if dtype_is_object:
20289  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20290  * dst.strides, ndim, inc)
20291  *
20292  */
20293  __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
20294  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20295 
20296  /* "View.MemoryView":1368
20297  *
20298  *
20299  * if dtype_is_object: # <<<<<<<<<<<<<<
20300  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20301  * dst.strides, ndim, inc)
20302  */
20303  }
20304 
20305  /* "View.MemoryView":1364
20306  *
20307  * @cname('__pyx_memoryview_refcount_copying')
20308  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20309  * int ndim, bint inc) nogil:
20310  *
20311  */
20312 
20313  /* function exit code */
20314  goto __pyx_L0;
20315  __pyx_L1_error:;
20316  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20317  __pyx_L0:;
20318  __Pyx_TraceReturn(Py_None, 1);
20319 }
20320 
20321 /* "View.MemoryView":1373
20322  *
20323  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20324  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20325  * Py_ssize_t *strides, int ndim,
20326  * bint inc) with gil:
20327  */
20328 
20329 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20330  __Pyx_TraceDeclarations
20331  __Pyx_RefNannyDeclarations
20332  int __pyx_lineno = 0;
20333  const char *__pyx_filename = NULL;
20334  int __pyx_clineno = 0;
20335  #ifdef WITH_THREAD
20336  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20337  #endif
20338  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20339  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
20340 
20341  /* "View.MemoryView":1376
20342  * Py_ssize_t *strides, int ndim,
20343  * bint inc) with gil:
20344  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20345  *
20346  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20347  */
20348  __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
20349  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20350 
20351  /* "View.MemoryView":1373
20352  *
20353  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20354  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20355  * Py_ssize_t *strides, int ndim,
20356  * bint inc) with gil:
20357  */
20358 
20359  /* function exit code */
20360  goto __pyx_L0;
20361  __pyx_L1_error:;
20362  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20363  __pyx_L0:;
20364  __Pyx_TraceReturn(Py_None, 0);
20365  __Pyx_RefNannyFinishContext();
20366  #ifdef WITH_THREAD
20367  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20368  #endif
20369 }
20370 
20371 /* "View.MemoryView":1379
20372  *
20373  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20374  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20375  * Py_ssize_t *strides, int ndim, bint inc):
20376  * cdef Py_ssize_t i
20377  */
20378 
20379 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20380  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20381  __Pyx_TraceDeclarations
20382  __Pyx_RefNannyDeclarations
20383  Py_ssize_t __pyx_t_1;
20384  Py_ssize_t __pyx_t_2;
20385  Py_ssize_t __pyx_t_3;
20386  int __pyx_t_4;
20387  int __pyx_lineno = 0;
20388  const char *__pyx_filename = NULL;
20389  int __pyx_clineno = 0;
20390  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20391  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
20392 
20393  /* "View.MemoryView":1383
20394  * cdef Py_ssize_t i
20395  *
20396  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20397  * if ndim == 1:
20398  * if inc:
20399  */
20400  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20401  __pyx_t_1 = (__pyx_v_shape[0]);
20402  __pyx_t_2 = __pyx_t_1;
20403  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20404  __pyx_v_i = __pyx_t_3;
20405 
20406  /* "View.MemoryView":1384
20407  *
20408  * for i in range(shape[0]):
20409  * if ndim == 1: # <<<<<<<<<<<<<<
20410  * if inc:
20411  * Py_INCREF((<PyObject **> data)[0])
20412  */
20413  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20414  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20415  if (__pyx_t_4) {
20416 
20417  /* "View.MemoryView":1385
20418  * for i in range(shape[0]):
20419  * if ndim == 1:
20420  * if inc: # <<<<<<<<<<<<<<
20421  * Py_INCREF((<PyObject **> data)[0])
20422  * else:
20423  */
20424  __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
20425  __pyx_t_4 = (__pyx_v_inc != 0);
20426  if (__pyx_t_4) {
20427 
20428  /* "View.MemoryView":1386
20429  * if ndim == 1:
20430  * if inc:
20431  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20432  * else:
20433  * Py_DECREF((<PyObject **> data)[0])
20434  */
20435  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20436  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20437 
20438  /* "View.MemoryView":1385
20439  * for i in range(shape[0]):
20440  * if ndim == 1:
20441  * if inc: # <<<<<<<<<<<<<<
20442  * Py_INCREF((<PyObject **> data)[0])
20443  * else:
20444  */
20445  goto __pyx_L6;
20446  }
20447 
20448  /* "View.MemoryView":1388
20449  * Py_INCREF((<PyObject **> data)[0])
20450  * else:
20451  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20452  * else:
20453  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20454  */
20455  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20456  /*else*/ {
20457  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20458  }
20459  __pyx_L6:;
20460 
20461  /* "View.MemoryView":1384
20462  *
20463  * for i in range(shape[0]):
20464  * if ndim == 1: # <<<<<<<<<<<<<<
20465  * if inc:
20466  * Py_INCREF((<PyObject **> data)[0])
20467  */
20468  goto __pyx_L5;
20469  }
20470 
20471  /* "View.MemoryView":1390
20472  * Py_DECREF((<PyObject **> data)[0])
20473  * else:
20474  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20475  * ndim - 1, inc)
20476  *
20477  */
20478  __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
20479  /*else*/ {
20480 
20481  /* "View.MemoryView":1391
20482  * else:
20483  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20484  * ndim - 1, inc) # <<<<<<<<<<<<<<
20485  *
20486  * data += strides[0]
20487  */
20488  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20489  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20490  }
20491  __pyx_L5:;
20492 
20493  /* "View.MemoryView":1393
20494  * ndim - 1, inc)
20495  *
20496  * data += strides[0] # <<<<<<<<<<<<<<
20497  *
20498  *
20499  */
20500  __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
20501  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20502  }
20503 
20504  /* "View.MemoryView":1379
20505  *
20506  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20507  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20508  * Py_ssize_t *strides, int ndim, bint inc):
20509  * cdef Py_ssize_t i
20510  */
20511 
20512  /* function exit code */
20513  goto __pyx_L0;
20514  __pyx_L1_error:;
20515  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20516  __pyx_L0:;
20517  __Pyx_TraceReturn(Py_None, 0);
20518  __Pyx_RefNannyFinishContext();
20519 }
20520 
20521 /* "View.MemoryView":1399
20522  *
20523  * @cname('__pyx_memoryview_slice_assign_scalar')
20524  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20525  * size_t itemsize, void *item,
20526  * bint dtype_is_object) nogil:
20527  */
20528 
20529 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20530  __Pyx_TraceDeclarations
20531  int __pyx_lineno = 0;
20532  const char *__pyx_filename = NULL;
20533  int __pyx_clineno = 0;
20534  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
20535 
20536  /* "View.MemoryView":1402
20537  * size_t itemsize, void *item,
20538  * bint dtype_is_object) nogil:
20539  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20540  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20541  * itemsize, item)
20542  */
20543  __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
20544  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20545 
20546  /* "View.MemoryView":1403
20547  * bint dtype_is_object) nogil:
20548  * refcount_copying(dst, dtype_is_object, ndim, False)
20549  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20550  * itemsize, item)
20551  * refcount_copying(dst, dtype_is_object, ndim, True)
20552  */
20553  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20554  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20555 
20556  /* "View.MemoryView":1405
20557  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20558  * itemsize, item)
20559  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20560  *
20561  *
20562  */
20563  __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
20564  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20565 
20566  /* "View.MemoryView":1399
20567  *
20568  * @cname('__pyx_memoryview_slice_assign_scalar')
20569  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20570  * size_t itemsize, void *item,
20571  * bint dtype_is_object) nogil:
20572  */
20573 
20574  /* function exit code */
20575  goto __pyx_L0;
20576  __pyx_L1_error:;
20577  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20578  __pyx_L0:;
20579  __Pyx_TraceReturn(Py_None, 1);
20580 }
20581 
20582 /* "View.MemoryView":1409
20583  *
20584  * @cname('__pyx_memoryview__slice_assign_scalar')
20585  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20586  * Py_ssize_t *strides, int ndim,
20587  * size_t itemsize, void *item) nogil:
20588  */
20589 
20590 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20591  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20592  Py_ssize_t __pyx_v_stride;
20593  Py_ssize_t __pyx_v_extent;
20594  __Pyx_TraceDeclarations
20595  int __pyx_t_1;
20596  Py_ssize_t __pyx_t_2;
20597  Py_ssize_t __pyx_t_3;
20598  Py_ssize_t __pyx_t_4;
20599  int __pyx_lineno = 0;
20600  const char *__pyx_filename = NULL;
20601  int __pyx_clineno = 0;
20602  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
20603 
20604  /* "View.MemoryView":1413
20605  * size_t itemsize, void *item) nogil:
20606  * cdef Py_ssize_t i
20607  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20608  * cdef Py_ssize_t extent = shape[0]
20609  *
20610  */
20611  __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
20612  __pyx_v_stride = (__pyx_v_strides[0]);
20613 
20614  /* "View.MemoryView":1414
20615  * cdef Py_ssize_t i
20616  * cdef Py_ssize_t stride = strides[0]
20617  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20618  *
20619  * if ndim == 1:
20620  */
20621  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20622  __pyx_v_extent = (__pyx_v_shape[0]);
20623 
20624  /* "View.MemoryView":1416
20625  * cdef Py_ssize_t extent = shape[0]
20626  *
20627  * if ndim == 1: # <<<<<<<<<<<<<<
20628  * for i in range(extent):
20629  * memcpy(data, item, itemsize)
20630  */
20631  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20632  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20633  if (__pyx_t_1) {
20634 
20635  /* "View.MemoryView":1417
20636  *
20637  * if ndim == 1:
20638  * for i in range(extent): # <<<<<<<<<<<<<<
20639  * memcpy(data, item, itemsize)
20640  * data += stride
20641  */
20642  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20643  __pyx_t_2 = __pyx_v_extent;
20644  __pyx_t_3 = __pyx_t_2;
20645  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20646  __pyx_v_i = __pyx_t_4;
20647 
20648  /* "View.MemoryView":1418
20649  * if ndim == 1:
20650  * for i in range(extent):
20651  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20652  * data += stride
20653  * else:
20654  */
20655  __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
20656  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20657 
20658  /* "View.MemoryView":1419
20659  * for i in range(extent):
20660  * memcpy(data, item, itemsize)
20661  * data += stride # <<<<<<<<<<<<<<
20662  * else:
20663  * for i in range(extent):
20664  */
20665  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20666  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20667  }
20668 
20669  /* "View.MemoryView":1416
20670  * cdef Py_ssize_t extent = shape[0]
20671  *
20672  * if ndim == 1: # <<<<<<<<<<<<<<
20673  * for i in range(extent):
20674  * memcpy(data, item, itemsize)
20675  */
20676  goto __pyx_L3;
20677  }
20678 
20679  /* "View.MemoryView":1421
20680  * data += stride
20681  * else:
20682  * for i in range(extent): # <<<<<<<<<<<<<<
20683  * _slice_assign_scalar(data, shape + 1, strides + 1,
20684  * ndim - 1, itemsize, item)
20685  */
20686  __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
20687  /*else*/ {
20688  __pyx_t_2 = __pyx_v_extent;
20689  __pyx_t_3 = __pyx_t_2;
20690  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20691  __pyx_v_i = __pyx_t_4;
20692 
20693  /* "View.MemoryView":1422
20694  * else:
20695  * for i in range(extent):
20696  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20697  * ndim - 1, itemsize, item)
20698  * data += stride
20699  */
20700  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20701  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20702 
20703  /* "View.MemoryView":1424
20704  * _slice_assign_scalar(data, shape + 1, strides + 1,
20705  * ndim - 1, itemsize, item)
20706  * data += stride # <<<<<<<<<<<<<<
20707  *
20708  *
20709  */
20710  __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
20711  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20712  }
20713  }
20714  __pyx_L3:;
20715 
20716  /* "View.MemoryView":1409
20717  *
20718  * @cname('__pyx_memoryview__slice_assign_scalar')
20719  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20720  * Py_ssize_t *strides, int ndim,
20721  * size_t itemsize, void *item) nogil:
20722  */
20723 
20724  /* function exit code */
20725  goto __pyx_L0;
20726  __pyx_L1_error:;
20727  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20728  __pyx_L0:;
20729  __Pyx_TraceReturn(Py_None, 1);
20730 }
20731 
20732 /* "(tree fragment)":1
20733  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20734  * cdef object __pyx_PickleError
20735  * cdef object __pyx_result
20736  */
20737 
20738 /* Python wrapper */
20739 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20740 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20741 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20742  PyObject *__pyx_v___pyx_type = 0;
20743  long __pyx_v___pyx_checksum;
20744  PyObject *__pyx_v___pyx_state = 0;
20745  int __pyx_lineno = 0;
20746  const char *__pyx_filename = NULL;
20747  int __pyx_clineno = 0;
20748  PyObject *__pyx_r = 0;
20749  __Pyx_RefNannyDeclarations
20750  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20751  {
20752  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20753  PyObject* values[3] = {0,0,0};
20754  if (unlikely(__pyx_kwds)) {
20755  Py_ssize_t kw_args;
20756  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20757  switch (pos_args) {
20758  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20759  CYTHON_FALLTHROUGH;
20760  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20761  CYTHON_FALLTHROUGH;
20762  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20763  CYTHON_FALLTHROUGH;
20764  case 0: break;
20765  default: goto __pyx_L5_argtuple_error;
20766  }
20767  kw_args = PyDict_Size(__pyx_kwds);
20768  switch (pos_args) {
20769  case 0:
20770  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20771  else goto __pyx_L5_argtuple_error;
20772  CYTHON_FALLTHROUGH;
20773  case 1:
20774  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20775  else {
20776  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20777  }
20778  CYTHON_FALLTHROUGH;
20779  case 2:
20780  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20781  else {
20782  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20783  }
20784  }
20785  if (unlikely(kw_args > 0)) {
20786  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20787  }
20788  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20789  goto __pyx_L5_argtuple_error;
20790  } else {
20791  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20792  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20793  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20794  }
20795  __pyx_v___pyx_type = values[0];
20796  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20797  __pyx_v___pyx_state = values[2];
20798  }
20799  goto __pyx_L4_argument_unpacking_done;
20800  __pyx_L5_argtuple_error:;
20801  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20802  __pyx_L3_error:;
20803  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20804  __Pyx_RefNannyFinishContext();
20805  return NULL;
20806  __pyx_L4_argument_unpacking_done:;
20807  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20808 
20809  /* function exit code */
20810  __Pyx_RefNannyFinishContext();
20811  return __pyx_r;
20812 }
20813 
20814 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20815  PyObject *__pyx_v___pyx_PickleError = 0;
20816  PyObject *__pyx_v___pyx_result = 0;
20817  PyObject *__pyx_r = NULL;
20818  __Pyx_TraceDeclarations
20819  __Pyx_RefNannyDeclarations
20820  PyObject *__pyx_t_1 = NULL;
20821  int __pyx_t_2;
20822  int __pyx_t_3;
20823  PyObject *__pyx_t_4 = NULL;
20824  PyObject *__pyx_t_5 = NULL;
20825  PyObject *__pyx_t_6 = NULL;
20826  int __pyx_lineno = 0;
20827  const char *__pyx_filename = NULL;
20828  int __pyx_clineno = 0;
20829  __Pyx_TraceFrameInit(__pyx_codeobj__36)
20830  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20831  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20832 
20833  /* "(tree fragment)":4
20834  * cdef object __pyx_PickleError
20835  * cdef object __pyx_result
20836  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20837  * from pickle import PickleError as __pyx_PickleError
20838  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20839  */
20840  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20841  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20842  __Pyx_GOTREF(__pyx_t_1);
20843  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20844  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20845  __pyx_t_3 = (__pyx_t_2 != 0);
20846  if (__pyx_t_3) {
20847 
20848  /* "(tree fragment)":5
20849  * cdef object __pyx_result
20850  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20851  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20852  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20853  * __pyx_result = Enum.__new__(__pyx_type)
20854  */
20855  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20856  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20857  __Pyx_GOTREF(__pyx_t_1);
20858  __Pyx_INCREF(__pyx_n_s_PickleError);
20859  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20860  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20861  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20862  __Pyx_GOTREF(__pyx_t_4);
20863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20864  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20865  __Pyx_GOTREF(__pyx_t_1);
20866  __Pyx_INCREF(__pyx_t_1);
20867  __pyx_v___pyx_PickleError = __pyx_t_1;
20868  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20869  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20870 
20871  /* "(tree fragment)":6
20872  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20873  * from pickle import PickleError as __pyx_PickleError
20874  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20875  * __pyx_result = Enum.__new__(__pyx_type)
20876  * if __pyx_state is not None:
20877  */
20878  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20879  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20880  __Pyx_GOTREF(__pyx_t_1);
20881  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20882  __Pyx_GOTREF(__pyx_t_5);
20883  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20884  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20885  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20886  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20887  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20888  if (likely(__pyx_t_6)) {
20889  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20890  __Pyx_INCREF(__pyx_t_6);
20891  __Pyx_INCREF(function);
20892  __Pyx_DECREF_SET(__pyx_t_1, function);
20893  }
20894  }
20895  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20896  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20897  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20898  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20899  __Pyx_GOTREF(__pyx_t_4);
20900  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20901  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20902  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20903  __PYX_ERR(1, 6, __pyx_L1_error)
20904 
20905  /* "(tree fragment)":4
20906  * cdef object __pyx_PickleError
20907  * cdef object __pyx_result
20908  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20909  * from pickle import PickleError as __pyx_PickleError
20910  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20911  */
20912  }
20913 
20914  /* "(tree fragment)":7
20915  * from pickle import PickleError as __pyx_PickleError
20916  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20917  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20918  * if __pyx_state is not None:
20919  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20920  */
20921  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20922  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20923  __Pyx_GOTREF(__pyx_t_1);
20924  __pyx_t_5 = NULL;
20925  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20926  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20927  if (likely(__pyx_t_5)) {
20928  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20929  __Pyx_INCREF(__pyx_t_5);
20930  __Pyx_INCREF(function);
20931  __Pyx_DECREF_SET(__pyx_t_1, function);
20932  }
20933  }
20934  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20935  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20936  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20937  __Pyx_GOTREF(__pyx_t_4);
20938  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20939  __pyx_v___pyx_result = __pyx_t_4;
20940  __pyx_t_4 = 0;
20941 
20942  /* "(tree fragment)":8
20943  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20944  * __pyx_result = Enum.__new__(__pyx_type)
20945  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20946  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20947  * return __pyx_result
20948  */
20949  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20950  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20951  __pyx_t_2 = (__pyx_t_3 != 0);
20952  if (__pyx_t_2) {
20953 
20954  /* "(tree fragment)":9
20955  * __pyx_result = Enum.__new__(__pyx_type)
20956  * if __pyx_state is not None:
20957  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20958  * return __pyx_result
20959  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20960  */
20961  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20962  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20963  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20964  __Pyx_GOTREF(__pyx_t_4);
20965  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20966 
20967  /* "(tree fragment)":8
20968  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20969  * __pyx_result = Enum.__new__(__pyx_type)
20970  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20971  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20972  * return __pyx_result
20973  */
20974  }
20975 
20976  /* "(tree fragment)":10
20977  * if __pyx_state is not None:
20978  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20979  * return __pyx_result # <<<<<<<<<<<<<<
20980  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20981  * __pyx_result.name = __pyx_state[0]
20982  */
20983  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20984  __Pyx_XDECREF(__pyx_r);
20985  __Pyx_INCREF(__pyx_v___pyx_result);
20986  __pyx_r = __pyx_v___pyx_result;
20987  goto __pyx_L0;
20988 
20989  /* "(tree fragment)":1
20990  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20991  * cdef object __pyx_PickleError
20992  * cdef object __pyx_result
20993  */
20994 
20995  /* function exit code */
20996  __pyx_L1_error:;
20997  __Pyx_XDECREF(__pyx_t_1);
20998  __Pyx_XDECREF(__pyx_t_4);
20999  __Pyx_XDECREF(__pyx_t_5);
21000  __Pyx_XDECREF(__pyx_t_6);
21001  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21002  __pyx_r = NULL;
21003  __pyx_L0:;
21004  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21005  __Pyx_XDECREF(__pyx_v___pyx_result);
21006  __Pyx_XGIVEREF(__pyx_r);
21007  __Pyx_TraceReturn(__pyx_r, 0);
21008  __Pyx_RefNannyFinishContext();
21009  return __pyx_r;
21010 }
21011 
21012 /* "(tree fragment)":11
21013  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21014  * return __pyx_result
21015  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21016  * __pyx_result.name = __pyx_state[0]
21017  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21018  */
21019 
21020 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21021  PyObject *__pyx_r = NULL;
21022  __Pyx_TraceDeclarations
21023  __Pyx_RefNannyDeclarations
21024  PyObject *__pyx_t_1 = NULL;
21025  int __pyx_t_2;
21026  Py_ssize_t __pyx_t_3;
21027  int __pyx_t_4;
21028  int __pyx_t_5;
21029  PyObject *__pyx_t_6 = NULL;
21030  PyObject *__pyx_t_7 = NULL;
21031  PyObject *__pyx_t_8 = NULL;
21032  int __pyx_lineno = 0;
21033  const char *__pyx_filename = NULL;
21034  int __pyx_clineno = 0;
21035  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21036  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21037 
21038  /* "(tree fragment)":12
21039  * return __pyx_result
21040  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21041  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21042  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21043  * __pyx_result.__dict__.update(__pyx_state[1])
21044  */
21045  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
21046  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21047  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21048  __PYX_ERR(1, 12, __pyx_L1_error)
21049  }
21050  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21051  __Pyx_GOTREF(__pyx_t_1);
21052  __Pyx_GIVEREF(__pyx_t_1);
21053  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21054  __Pyx_DECREF(__pyx_v___pyx_result->name);
21055  __pyx_v___pyx_result->name = __pyx_t_1;
21056  __pyx_t_1 = 0;
21057 
21058  /* "(tree fragment)":13
21059  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21060  * __pyx_result.name = __pyx_state[0]
21061  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21062  * __pyx_result.__dict__.update(__pyx_state[1])
21063  */
21064  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
21065  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21066  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21067  __PYX_ERR(1, 13, __pyx_L1_error)
21068  }
21069  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21070  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21071  if (__pyx_t_4) {
21072  } else {
21073  __pyx_t_2 = __pyx_t_4;
21074  goto __pyx_L4_bool_binop_done;
21075  }
21076  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21077  __pyx_t_5 = (__pyx_t_4 != 0);
21078  __pyx_t_2 = __pyx_t_5;
21079  __pyx_L4_bool_binop_done:;
21080  if (__pyx_t_2) {
21081 
21082  /* "(tree fragment)":14
21083  * __pyx_result.name = __pyx_state[0]
21084  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21085  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21086  */
21087  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
21088  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21089  __Pyx_GOTREF(__pyx_t_6);
21090  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21091  __Pyx_GOTREF(__pyx_t_7);
21092  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21093  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21094  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21095  __PYX_ERR(1, 14, __pyx_L1_error)
21096  }
21097  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21098  __Pyx_GOTREF(__pyx_t_6);
21099  __pyx_t_8 = NULL;
21100  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21101  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21102  if (likely(__pyx_t_8)) {
21103  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21104  __Pyx_INCREF(__pyx_t_8);
21105  __Pyx_INCREF(function);
21106  __Pyx_DECREF_SET(__pyx_t_7, function);
21107  }
21108  }
21109  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21110  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21111  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21112  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21113  __Pyx_GOTREF(__pyx_t_1);
21114  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21115  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21116 
21117  /* "(tree fragment)":13
21118  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21119  * __pyx_result.name = __pyx_state[0]
21120  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21121  * __pyx_result.__dict__.update(__pyx_state[1])
21122  */
21123  }
21124 
21125  /* "(tree fragment)":11
21126  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21127  * return __pyx_result
21128  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21129  * __pyx_result.name = __pyx_state[0]
21130  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21131  */
21132 
21133  /* function exit code */
21134  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21135  goto __pyx_L0;
21136  __pyx_L1_error:;
21137  __Pyx_XDECREF(__pyx_t_1);
21138  __Pyx_XDECREF(__pyx_t_6);
21139  __Pyx_XDECREF(__pyx_t_7);
21140  __Pyx_XDECREF(__pyx_t_8);
21141  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21142  __pyx_r = 0;
21143  __pyx_L0:;
21144  __Pyx_XGIVEREF(__pyx_r);
21145  __Pyx_TraceReturn(__pyx_r, 0);
21146  __Pyx_RefNannyFinishContext();
21147  return __pyx_r;
21148 }
21149 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21150 
21151 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21152  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
21153  PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
21154  if (unlikely(!o)) return 0;
21155  p = ((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
21156  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21157  p->A_csr = Py_None; Py_INCREF(Py_None);
21158  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21159  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21160  if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0)) goto bad;
21161  return o;
21162  bad:
21163  Py_DECREF(o); o = 0;
21164  return NULL;
21165 }
21166 
21167 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21168  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21169  #if CYTHON_USE_TP_FINALIZE
21170  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21171  if (PyObject_CallFinalizerFromDealloc(o)) return;
21172  }
21173  #endif
21174  PyObject_GC_UnTrack(o);
21175  Py_CLEAR(p->A_csr);
21176  Py_CLEAR(p->A_indices_copy);
21177  Py_CLEAR(p->A_index_pointer_copy);
21178  PyObject_GC_Track(o);
21179  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21180 }
21181 
21182 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v, void *a) {
21183  int e;
21184  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21185  e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix)); if (e) return e;
21186  if (p->A_csr) {
21187  e = (*v)(p->A_csr, a); if (e) return e;
21188  }
21189  if (p->A_indices_copy) {
21190  e = (*v)(p->A_indices_copy, a); if (e) return e;
21191  }
21192  if (p->A_index_pointer_copy) {
21193  e = (*v)(p->A_index_pointer_copy, a); if (e) return e;
21194  }
21195  return 0;
21196 }
21197 
21198 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21199  PyObject* tmp;
21200  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21201  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) { if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21202  tmp = ((PyObject*)p->A_csr);
21203  p->A_csr = Py_None; Py_INCREF(Py_None);
21204  Py_XDECREF(tmp);
21205  tmp = ((PyObject*)p->A_indices_copy);
21206  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21207  Py_XDECREF(tmp);
21208  tmp = ((PyObject*)p->A_index_pointer_copy);
21209  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21210  Py_XDECREF(tmp);
21211  return 0;
21212 }
21213 
21214 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
21215  {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
21216  {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
21217  {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
21218  {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
21219  {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
21220  {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
21221  {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
21222  {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
21223  {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
21224  {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
21225  {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
21226  {0, 0, 0, 0}
21227 };
21228 
21229 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
21230  PyVarObject_HEAD_INIT(0, 0)
21231  "imate._c_linear_operator.py_c_matrix.pycMatrix", /*tp_name*/
21232  sizeof(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix), /*tp_basicsize*/
21233  0, /*tp_itemsize*/
21234  __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_dealloc*/
21235  #if PY_VERSION_HEX < 0x030800b4
21236  0, /*tp_print*/
21237  #endif
21238  #if PY_VERSION_HEX >= 0x030800b4
21239  0, /*tp_vectorcall_offset*/
21240  #endif
21241  0, /*tp_getattr*/
21242  0, /*tp_setattr*/
21243  #if PY_MAJOR_VERSION < 3
21244  0, /*tp_compare*/
21245  #endif
21246  #if PY_MAJOR_VERSION >= 3
21247  0, /*tp_as_async*/
21248  #endif
21249  0, /*tp_repr*/
21250  0, /*tp_as_number*/
21251  0, /*tp_as_sequence*/
21252  0, /*tp_as_mapping*/
21253  0, /*tp_hash*/
21254  0, /*tp_call*/
21255  0, /*tp_str*/
21256  0, /*tp_getattro*/
21257  0, /*tp_setattro*/
21258  0, /*tp_as_buffer*/
21259  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21260  "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ", /*tp_doc*/
21261  __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_traverse*/
21262  __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_clear*/
21263  0, /*tp_richcompare*/
21264  0, /*tp_weaklistoffset*/
21265  0, /*tp_iter*/
21266  0, /*tp_iternext*/
21267  __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_methods*/
21268  0, /*tp_members*/
21269  0, /*tp_getset*/
21270  0, /*tp_base*/
21271  0, /*tp_dict*/
21272  0, /*tp_descr_get*/
21273  0, /*tp_descr_set*/
21274  0, /*tp_dictoffset*/
21275  0, /*tp_init*/
21276  0, /*tp_alloc*/
21277  __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_new*/
21278  0, /*tp_free*/
21279  0, /*tp_is_gc*/
21280  0, /*tp_bases*/
21281  0, /*tp_mro*/
21282  0, /*tp_cache*/
21283  0, /*tp_subclasses*/
21284  0, /*tp_weaklist*/
21285  0, /*tp_del*/
21286  0, /*tp_version_tag*/
21287  #if PY_VERSION_HEX >= 0x030400a1
21288  0, /*tp_finalize*/
21289  #endif
21290  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21291  0, /*tp_vectorcall*/
21292  #endif
21293  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21294  0, /*tp_print*/
21295  #endif
21296  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21297  0, /*tp_pypy_flags*/
21298  #endif
21299 };
21300 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21301 
21302 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21303  struct __pyx_array_obj *p;
21304  PyObject *o;
21305  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21306  o = (*t->tp_alloc)(t, 0);
21307  } else {
21308  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21309  }
21310  if (unlikely(!o)) return 0;
21311  p = ((struct __pyx_array_obj *)o);
21312  p->__pyx_vtab = __pyx_vtabptr_array;
21313  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21314  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21315  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21316  return o;
21317  bad:
21318  Py_DECREF(o); o = 0;
21319  return NULL;
21320 }
21321 
21322 static void __pyx_tp_dealloc_array(PyObject *o) {
21323  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21324  #if CYTHON_USE_TP_FINALIZE
21325  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
21326  if (PyObject_CallFinalizerFromDealloc(o)) return;
21327  }
21328  #endif
21329  {
21330  PyObject *etype, *eval, *etb;
21331  PyErr_Fetch(&etype, &eval, &etb);
21332  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21333  __pyx_array___dealloc__(o);
21334  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21335  PyErr_Restore(etype, eval, etb);
21336  }
21337  Py_CLEAR(p->mode);
21338  Py_CLEAR(p->_format);
21339  (*Py_TYPE(o)->tp_free)(o);
21340 }
21341 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21342  PyObject *r;
21343  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21344  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21345  Py_DECREF(x);
21346  return r;
21347 }
21348 
21349 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21350  if (v) {
21351  return __pyx_array___setitem__(o, i, v);
21352  }
21353  else {
21354  PyErr_Format(PyExc_NotImplementedError,
21355  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21356  return -1;
21357  }
21358 }
21359 
21360 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21361  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21362  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21363  PyErr_Clear();
21364  v = __pyx_array___getattr__(o, n);
21365  }
21366  return v;
21367 }
21368 
21369 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21370  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21371 }
21372 
21373 static PyMethodDef __pyx_methods_array[] = {
21374  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21375  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21376  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21377  {0, 0, 0, 0}
21378 };
21379 
21380 static struct PyGetSetDef __pyx_getsets_array[] = {
21381  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21382  {0, 0, 0, 0, 0}
21383 };
21384 
21385 static PySequenceMethods __pyx_tp_as_sequence_array = {
21386  __pyx_array___len__, /*sq_length*/
21387  0, /*sq_concat*/
21388  0, /*sq_repeat*/
21389  __pyx_sq_item_array, /*sq_item*/
21390  0, /*sq_slice*/
21391  0, /*sq_ass_item*/
21392  0, /*sq_ass_slice*/
21393  0, /*sq_contains*/
21394  0, /*sq_inplace_concat*/
21395  0, /*sq_inplace_repeat*/
21396 };
21397 
21398 static PyMappingMethods __pyx_tp_as_mapping_array = {
21399  __pyx_array___len__, /*mp_length*/
21400  __pyx_array___getitem__, /*mp_subscript*/
21401  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21402 };
21403 
21404 static PyBufferProcs __pyx_tp_as_buffer_array = {
21405  #if PY_MAJOR_VERSION < 3
21406  0, /*bf_getreadbuffer*/
21407  #endif
21408  #if PY_MAJOR_VERSION < 3
21409  0, /*bf_getwritebuffer*/
21410  #endif
21411  #if PY_MAJOR_VERSION < 3
21412  0, /*bf_getsegcount*/
21413  #endif
21414  #if PY_MAJOR_VERSION < 3
21415  0, /*bf_getcharbuffer*/
21416  #endif
21417  __pyx_array_getbuffer, /*bf_getbuffer*/
21418  0, /*bf_releasebuffer*/
21419 };
21420 
21421 static PyTypeObject __pyx_type___pyx_array = {
21422  PyVarObject_HEAD_INIT(0, 0)
21423  "imate._c_linear_operator.py_c_matrix.array", /*tp_name*/
21424  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21425  0, /*tp_itemsize*/
21426  __pyx_tp_dealloc_array, /*tp_dealloc*/
21427  #if PY_VERSION_HEX < 0x030800b4
21428  0, /*tp_print*/
21429  #endif
21430  #if PY_VERSION_HEX >= 0x030800b4
21431  0, /*tp_vectorcall_offset*/
21432  #endif
21433  0, /*tp_getattr*/
21434  0, /*tp_setattr*/
21435  #if PY_MAJOR_VERSION < 3
21436  0, /*tp_compare*/
21437  #endif
21438  #if PY_MAJOR_VERSION >= 3
21439  0, /*tp_as_async*/
21440  #endif
21441  0, /*tp_repr*/
21442  0, /*tp_as_number*/
21443  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21444  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21445  0, /*tp_hash*/
21446  0, /*tp_call*/
21447  0, /*tp_str*/
21448  __pyx_tp_getattro_array, /*tp_getattro*/
21449  0, /*tp_setattro*/
21450  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21451  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21452  0, /*tp_doc*/
21453  0, /*tp_traverse*/
21454  0, /*tp_clear*/
21455  0, /*tp_richcompare*/
21456  0, /*tp_weaklistoffset*/
21457  0, /*tp_iter*/
21458  0, /*tp_iternext*/
21459  __pyx_methods_array, /*tp_methods*/
21460  0, /*tp_members*/
21461  __pyx_getsets_array, /*tp_getset*/
21462  0, /*tp_base*/
21463  0, /*tp_dict*/
21464  0, /*tp_descr_get*/
21465  0, /*tp_descr_set*/
21466  0, /*tp_dictoffset*/
21467  0, /*tp_init*/
21468  0, /*tp_alloc*/
21469  __pyx_tp_new_array, /*tp_new*/
21470  0, /*tp_free*/
21471  0, /*tp_is_gc*/
21472  0, /*tp_bases*/
21473  0, /*tp_mro*/
21474  0, /*tp_cache*/
21475  0, /*tp_subclasses*/
21476  0, /*tp_weaklist*/
21477  0, /*tp_del*/
21478  0, /*tp_version_tag*/
21479  #if PY_VERSION_HEX >= 0x030400a1
21480  0, /*tp_finalize*/
21481  #endif
21482  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21483  0, /*tp_vectorcall*/
21484  #endif
21485  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21486  0, /*tp_print*/
21487  #endif
21488  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21489  0, /*tp_pypy_flags*/
21490  #endif
21491 };
21492 
21493 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21494  struct __pyx_MemviewEnum_obj *p;
21495  PyObject *o;
21496  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21497  o = (*t->tp_alloc)(t, 0);
21498  } else {
21499  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21500  }
21501  if (unlikely(!o)) return 0;
21502  p = ((struct __pyx_MemviewEnum_obj *)o);
21503  p->name = Py_None; Py_INCREF(Py_None);
21504  return o;
21505 }
21506 
21507 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21508  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21509  #if CYTHON_USE_TP_FINALIZE
21510  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21511  if (PyObject_CallFinalizerFromDealloc(o)) return;
21512  }
21513  #endif
21514  PyObject_GC_UnTrack(o);
21515  Py_CLEAR(p->name);
21516  (*Py_TYPE(o)->tp_free)(o);
21517 }
21518 
21519 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21520  int e;
21521  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21522  if (p->name) {
21523  e = (*v)(p->name, a); if (e) return e;
21524  }
21525  return 0;
21526 }
21527 
21528 static int __pyx_tp_clear_Enum(PyObject *o) {
21529  PyObject* tmp;
21530  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21531  tmp = ((PyObject*)p->name);
21532  p->name = Py_None; Py_INCREF(Py_None);
21533  Py_XDECREF(tmp);
21534  return 0;
21535 }
21536 
21537 static PyMethodDef __pyx_methods_Enum[] = {
21538  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21539  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21540  {0, 0, 0, 0}
21541 };
21542 
21543 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21544  PyVarObject_HEAD_INIT(0, 0)
21545  "imate._c_linear_operator.py_c_matrix.Enum", /*tp_name*/
21546  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21547  0, /*tp_itemsize*/
21548  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21549  #if PY_VERSION_HEX < 0x030800b4
21550  0, /*tp_print*/
21551  #endif
21552  #if PY_VERSION_HEX >= 0x030800b4
21553  0, /*tp_vectorcall_offset*/
21554  #endif
21555  0, /*tp_getattr*/
21556  0, /*tp_setattr*/
21557  #if PY_MAJOR_VERSION < 3
21558  0, /*tp_compare*/
21559  #endif
21560  #if PY_MAJOR_VERSION >= 3
21561  0, /*tp_as_async*/
21562  #endif
21563  __pyx_MemviewEnum___repr__, /*tp_repr*/
21564  0, /*tp_as_number*/
21565  0, /*tp_as_sequence*/
21566  0, /*tp_as_mapping*/
21567  0, /*tp_hash*/
21568  0, /*tp_call*/
21569  0, /*tp_str*/
21570  0, /*tp_getattro*/
21571  0, /*tp_setattro*/
21572  0, /*tp_as_buffer*/
21573  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21574  0, /*tp_doc*/
21575  __pyx_tp_traverse_Enum, /*tp_traverse*/
21576  __pyx_tp_clear_Enum, /*tp_clear*/
21577  0, /*tp_richcompare*/
21578  0, /*tp_weaklistoffset*/
21579  0, /*tp_iter*/
21580  0, /*tp_iternext*/
21581  __pyx_methods_Enum, /*tp_methods*/
21582  0, /*tp_members*/
21583  0, /*tp_getset*/
21584  0, /*tp_base*/
21585  0, /*tp_dict*/
21586  0, /*tp_descr_get*/
21587  0, /*tp_descr_set*/
21588  0, /*tp_dictoffset*/
21589  __pyx_MemviewEnum___init__, /*tp_init*/
21590  0, /*tp_alloc*/
21591  __pyx_tp_new_Enum, /*tp_new*/
21592  0, /*tp_free*/
21593  0, /*tp_is_gc*/
21594  0, /*tp_bases*/
21595  0, /*tp_mro*/
21596  0, /*tp_cache*/
21597  0, /*tp_subclasses*/
21598  0, /*tp_weaklist*/
21599  0, /*tp_del*/
21600  0, /*tp_version_tag*/
21601  #if PY_VERSION_HEX >= 0x030400a1
21602  0, /*tp_finalize*/
21603  #endif
21604  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21605  0, /*tp_vectorcall*/
21606  #endif
21607  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21608  0, /*tp_print*/
21609  #endif
21610  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21611  0, /*tp_pypy_flags*/
21612  #endif
21613 };
21614 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21615 
21616 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21617  struct __pyx_memoryview_obj *p;
21618  PyObject *o;
21619  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21620  o = (*t->tp_alloc)(t, 0);
21621  } else {
21622  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21623  }
21624  if (unlikely(!o)) return 0;
21625  p = ((struct __pyx_memoryview_obj *)o);
21626  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21627  p->obj = Py_None; Py_INCREF(Py_None);
21628  p->_size = Py_None; Py_INCREF(Py_None);
21629  p->_array_interface = Py_None; Py_INCREF(Py_None);
21630  p->view.obj = NULL;
21631  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21632  return o;
21633  bad:
21634  Py_DECREF(o); o = 0;
21635  return NULL;
21636 }
21637 
21638 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21639  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21640  #if CYTHON_USE_TP_FINALIZE
21641  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21642  if (PyObject_CallFinalizerFromDealloc(o)) return;
21643  }
21644  #endif
21645  PyObject_GC_UnTrack(o);
21646  {
21647  PyObject *etype, *eval, *etb;
21648  PyErr_Fetch(&etype, &eval, &etb);
21649  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21650  __pyx_memoryview___dealloc__(o);
21651  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21652  PyErr_Restore(etype, eval, etb);
21653  }
21654  Py_CLEAR(p->obj);
21655  Py_CLEAR(p->_size);
21656  Py_CLEAR(p->_array_interface);
21657  (*Py_TYPE(o)->tp_free)(o);
21658 }
21659 
21660 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21661  int e;
21662  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21663  if (p->obj) {
21664  e = (*v)(p->obj, a); if (e) return e;
21665  }
21666  if (p->_size) {
21667  e = (*v)(p->_size, a); if (e) return e;
21668  }
21669  if (p->_array_interface) {
21670  e = (*v)(p->_array_interface, a); if (e) return e;
21671  }
21672  if (p->view.obj) {
21673  e = (*v)(p->view.obj, a); if (e) return e;
21674  }
21675  return 0;
21676 }
21677 
21678 static int __pyx_tp_clear_memoryview(PyObject *o) {
21679  PyObject* tmp;
21680  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21681  tmp = ((PyObject*)p->obj);
21682  p->obj = Py_None; Py_INCREF(Py_None);
21683  Py_XDECREF(tmp);
21684  tmp = ((PyObject*)p->_size);
21685  p->_size = Py_None; Py_INCREF(Py_None);
21686  Py_XDECREF(tmp);
21687  tmp = ((PyObject*)p->_array_interface);
21688  p->_array_interface = Py_None; Py_INCREF(Py_None);
21689  Py_XDECREF(tmp);
21690  Py_CLEAR(p->view.obj);
21691  return 0;
21692 }
21693 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21694  PyObject *r;
21695  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21696  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21697  Py_DECREF(x);
21698  return r;
21699 }
21700 
21701 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21702  if (v) {
21703  return __pyx_memoryview___setitem__(o, i, v);
21704  }
21705  else {
21706  PyErr_Format(PyExc_NotImplementedError,
21707  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21708  return -1;
21709  }
21710 }
21711 
21712 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21713  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21714 }
21715 
21716 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21717  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21718 }
21719 
21720 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21721  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21722 }
21723 
21724 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21725  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21726 }
21727 
21728 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21729  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21730 }
21731 
21732 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21733  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21734 }
21735 
21736 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21737  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21738 }
21739 
21740 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21741  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21742 }
21743 
21744 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21745  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21746 }
21747 
21748 static PyMethodDef __pyx_methods_memoryview[] = {
21749  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21750  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21751  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21752  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21753  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21754  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21755  {0, 0, 0, 0}
21756 };
21757 
21758 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21759  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21760  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21761  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21762  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21763  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21764  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21765  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21766  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21767  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21768  {0, 0, 0, 0, 0}
21769 };
21770 
21771 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21772  __pyx_memoryview___len__, /*sq_length*/
21773  0, /*sq_concat*/
21774  0, /*sq_repeat*/
21775  __pyx_sq_item_memoryview, /*sq_item*/
21776  0, /*sq_slice*/
21777  0, /*sq_ass_item*/
21778  0, /*sq_ass_slice*/
21779  0, /*sq_contains*/
21780  0, /*sq_inplace_concat*/
21781  0, /*sq_inplace_repeat*/
21782 };
21783 
21784 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21785  __pyx_memoryview___len__, /*mp_length*/
21786  __pyx_memoryview___getitem__, /*mp_subscript*/
21787  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21788 };
21789 
21790 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21791  #if PY_MAJOR_VERSION < 3
21792  0, /*bf_getreadbuffer*/
21793  #endif
21794  #if PY_MAJOR_VERSION < 3
21795  0, /*bf_getwritebuffer*/
21796  #endif
21797  #if PY_MAJOR_VERSION < 3
21798  0, /*bf_getsegcount*/
21799  #endif
21800  #if PY_MAJOR_VERSION < 3
21801  0, /*bf_getcharbuffer*/
21802  #endif
21803  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21804  0, /*bf_releasebuffer*/
21805 };
21806 
21807 static PyTypeObject __pyx_type___pyx_memoryview = {
21808  PyVarObject_HEAD_INIT(0, 0)
21809  "imate._c_linear_operator.py_c_matrix.memoryview", /*tp_name*/
21810  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21811  0, /*tp_itemsize*/
21812  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21813  #if PY_VERSION_HEX < 0x030800b4
21814  0, /*tp_print*/
21815  #endif
21816  #if PY_VERSION_HEX >= 0x030800b4
21817  0, /*tp_vectorcall_offset*/
21818  #endif
21819  0, /*tp_getattr*/
21820  0, /*tp_setattr*/
21821  #if PY_MAJOR_VERSION < 3
21822  0, /*tp_compare*/
21823  #endif
21824  #if PY_MAJOR_VERSION >= 3
21825  0, /*tp_as_async*/
21826  #endif
21827  __pyx_memoryview___repr__, /*tp_repr*/
21828  0, /*tp_as_number*/
21829  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21830  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21831  0, /*tp_hash*/
21832  0, /*tp_call*/
21833  __pyx_memoryview___str__, /*tp_str*/
21834  0, /*tp_getattro*/
21835  0, /*tp_setattro*/
21836  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21837  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21838  0, /*tp_doc*/
21839  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21840  __pyx_tp_clear_memoryview, /*tp_clear*/
21841  0, /*tp_richcompare*/
21842  0, /*tp_weaklistoffset*/
21843  0, /*tp_iter*/
21844  0, /*tp_iternext*/
21845  __pyx_methods_memoryview, /*tp_methods*/
21846  0, /*tp_members*/
21847  __pyx_getsets_memoryview, /*tp_getset*/
21848  0, /*tp_base*/
21849  0, /*tp_dict*/
21850  0, /*tp_descr_get*/
21851  0, /*tp_descr_set*/
21852  0, /*tp_dictoffset*/
21853  0, /*tp_init*/
21854  0, /*tp_alloc*/
21855  __pyx_tp_new_memoryview, /*tp_new*/
21856  0, /*tp_free*/
21857  0, /*tp_is_gc*/
21858  0, /*tp_bases*/
21859  0, /*tp_mro*/
21860  0, /*tp_cache*/
21861  0, /*tp_subclasses*/
21862  0, /*tp_weaklist*/
21863  0, /*tp_del*/
21864  0, /*tp_version_tag*/
21865  #if PY_VERSION_HEX >= 0x030400a1
21866  0, /*tp_finalize*/
21867  #endif
21868  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21869  0, /*tp_vectorcall*/
21870  #endif
21871  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21872  0, /*tp_print*/
21873  #endif
21874  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21875  0, /*tp_pypy_flags*/
21876  #endif
21877 };
21878 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21879 
21880 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21881  struct __pyx_memoryviewslice_obj *p;
21882  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21883  if (unlikely(!o)) return 0;
21884  p = ((struct __pyx_memoryviewslice_obj *)o);
21885  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21886  p->from_object = Py_None; Py_INCREF(Py_None);
21887  p->from_slice.memview = NULL;
21888  return o;
21889 }
21890 
21891 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21892  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21893  #if CYTHON_USE_TP_FINALIZE
21894  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21895  if (PyObject_CallFinalizerFromDealloc(o)) return;
21896  }
21897  #endif
21898  PyObject_GC_UnTrack(o);
21899  {
21900  PyObject *etype, *eval, *etb;
21901  PyErr_Fetch(&etype, &eval, &etb);
21902  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21903  __pyx_memoryviewslice___dealloc__(o);
21904  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21905  PyErr_Restore(etype, eval, etb);
21906  }
21907  Py_CLEAR(p->from_object);
21908  PyObject_GC_Track(o);
21909  __pyx_tp_dealloc_memoryview(o);
21910 }
21911 
21912 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21913  int e;
21914  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21915  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21916  if (p->from_object) {
21917  e = (*v)(p->from_object, a); if (e) return e;
21918  }
21919  return 0;
21920 }
21921 
21922 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21923  PyObject* tmp;
21924  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21925  __pyx_tp_clear_memoryview(o);
21926  tmp = ((PyObject*)p->from_object);
21927  p->from_object = Py_None; Py_INCREF(Py_None);
21928  Py_XDECREF(tmp);
21929  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21930  return 0;
21931 }
21932 
21933 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21934  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21935 }
21936 
21937 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21938  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21939  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21940  {0, 0, 0, 0}
21941 };
21942 
21943 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21944  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21945  {0, 0, 0, 0, 0}
21946 };
21947 
21948 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21949  PyVarObject_HEAD_INIT(0, 0)
21950  "imate._c_linear_operator.py_c_matrix._memoryviewslice", /*tp_name*/
21951  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21952  0, /*tp_itemsize*/
21953  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21954  #if PY_VERSION_HEX < 0x030800b4
21955  0, /*tp_print*/
21956  #endif
21957  #if PY_VERSION_HEX >= 0x030800b4
21958  0, /*tp_vectorcall_offset*/
21959  #endif
21960  0, /*tp_getattr*/
21961  0, /*tp_setattr*/
21962  #if PY_MAJOR_VERSION < 3
21963  0, /*tp_compare*/
21964  #endif
21965  #if PY_MAJOR_VERSION >= 3
21966  0, /*tp_as_async*/
21967  #endif
21968  #if CYTHON_COMPILING_IN_PYPY
21969  __pyx_memoryview___repr__, /*tp_repr*/
21970  #else
21971  0, /*tp_repr*/
21972  #endif
21973  0, /*tp_as_number*/
21974  0, /*tp_as_sequence*/
21975  0, /*tp_as_mapping*/
21976  0, /*tp_hash*/
21977  0, /*tp_call*/
21978  #if CYTHON_COMPILING_IN_PYPY
21979  __pyx_memoryview___str__, /*tp_str*/
21980  #else
21981  0, /*tp_str*/
21982  #endif
21983  0, /*tp_getattro*/
21984  0, /*tp_setattro*/
21985  0, /*tp_as_buffer*/
21986  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21987  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21988  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21989  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21990  0, /*tp_richcompare*/
21991  0, /*tp_weaklistoffset*/
21992  0, /*tp_iter*/
21993  0, /*tp_iternext*/
21994  __pyx_methods__memoryviewslice, /*tp_methods*/
21995  0, /*tp_members*/
21996  __pyx_getsets__memoryviewslice, /*tp_getset*/
21997  0, /*tp_base*/
21998  0, /*tp_dict*/
21999  0, /*tp_descr_get*/
22000  0, /*tp_descr_set*/
22001  0, /*tp_dictoffset*/
22002  0, /*tp_init*/
22003  0, /*tp_alloc*/
22004  __pyx_tp_new__memoryviewslice, /*tp_new*/
22005  0, /*tp_free*/
22006  0, /*tp_is_gc*/
22007  0, /*tp_bases*/
22008  0, /*tp_mro*/
22009  0, /*tp_cache*/
22010  0, /*tp_subclasses*/
22011  0, /*tp_weaklist*/
22012  0, /*tp_del*/
22013  0, /*tp_version_tag*/
22014  #if PY_VERSION_HEX >= 0x030400a1
22015  0, /*tp_finalize*/
22016  #endif
22017  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22018  0, /*tp_vectorcall*/
22019  #endif
22020  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22021  0, /*tp_print*/
22022  #endif
22023  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
22024  0, /*tp_pypy_flags*/
22025  #endif
22026 };
22027 
22028 static PyMethodDef __pyx_methods[] = {
22029  {0, 0, 0, 0}
22030 };
22031 
22032 #if PY_MAJOR_VERSION >= 3
22033 #if CYTHON_PEP489_MULTI_PHASE_INIT
22034 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22035 static int __pyx_pymod_exec_py_c_matrix(PyObject* module); /*proto*/
22036 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22037  {Py_mod_create, (void*)__pyx_pymod_create},
22038  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_matrix},
22039  {0, NULL}
22040 };
22041 #endif
22042 
22043 static struct PyModuleDef __pyx_moduledef = {
22044  PyModuleDef_HEAD_INIT,
22045  "py_c_matrix",
22046  0, /* m_doc */
22047  #if CYTHON_PEP489_MULTI_PHASE_INIT
22048  0, /* m_size */
22049  #else
22050  -1, /* m_size */
22051  #endif
22052  __pyx_methods /* m_methods */,
22053  #if CYTHON_PEP489_MULTI_PHASE_INIT
22054  __pyx_moduledef_slots, /* m_slots */
22055  #else
22056  NULL, /* m_reload */
22057  #endif
22058  NULL, /* m_traverse */
22059  NULL, /* m_clear */
22060  NULL /* m_free */
22061 };
22062 #endif
22063 #ifndef CYTHON_SMALL_CODE
22064 #if defined(__clang__)
22065  #define CYTHON_SMALL_CODE
22066 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22067  #define CYTHON_SMALL_CODE __attribute__((cold))
22068 #else
22069  #define CYTHON_SMALL_CODE
22070 #endif
22071 #endif
22072 
22073 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22074  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
22075  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22076  {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None, sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
22077  {&__pyx_n_s_A_data_double, __pyx_k_A_data_double, sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
22078  {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv, sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
22079  {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c, sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
22080  {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f, sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
22081  {&__pyx_n_s_A_data_float, __pyx_k_A_data_float, sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
22082  {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv, sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
22083  {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c, sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
22084  {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f, sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
22085  {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double, sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
22086  {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv, sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
22087  {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c, sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
22088  {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f, sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
22089  {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer, sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
22090  {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv, sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
22091  {&__pyx_n_s_A_indices, __pyx_k_A_indices, sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
22092  {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv, sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
22093  {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major, sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
22094  {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns, sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
22095  {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows, sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
22096  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22097  {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
22098  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22099  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22100  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22101  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22102  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
22103  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22104  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22105  {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
22106  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
22107  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22108  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22109  {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen, sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
22110  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22111  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22112  {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
22113  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22114  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22115  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22116  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22117  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22118  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22119  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22120  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22121  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22122  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22123  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22124  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
22125  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22126  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22127  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22128  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22129  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22130  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22131  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22132  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
22133  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
22134  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
22135  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22136  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
22137  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22138  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22139  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22140  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22141  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22142  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
22143  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
22144  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
22145  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22146  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22147  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22148  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22149  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22150  {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
22151  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22152  {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
22153  {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
22154  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22155  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
22156  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
22157  {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
22158  {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc, sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
22159  {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr, sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
22160  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22161  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22162  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22163  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22164  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22165  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22166  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22167  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22168  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22169  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22170  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22171  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22172  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22173  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22174  {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix, sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
22175  {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython, sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
22176  {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython, sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
22177  {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double, sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
22178  {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float, sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
22179  {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
22180  {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double, sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
22181  {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float, sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
22182  {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
22183  {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl, sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
22184  {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float, sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
22185  {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long, sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
22186  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22187  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22188  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22189  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22190  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22191  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22192  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22193  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22194  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22195  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22196  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22197  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22198  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
22199  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22200  {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double, sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
22201  {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float, sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
22202  {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double, sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
22203  {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double, sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
22204  {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float, sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
22205  {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double, sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
22206  {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double, sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
22207  {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float, sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
22208  {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double, sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
22209  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22210  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22211  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22212  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22213  {&__pyx_n_s_sort_indices, __pyx_k_sort_indices, sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
22214  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22215  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22216  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22217  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22218  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22219  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22220  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22221  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22222  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22223  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22224  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22225  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22226  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22227  {0, 0, 0, 0, 0, 0, 0}
22228 };
22229 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22230  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
22231  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
22232  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
22233  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
22234  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
22235  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
22236  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
22237  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
22238  return 0;
22239  __pyx_L1_error:;
22240  return -1;
22241 }
22242 
22243 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22244  __Pyx_RefNannyDeclarations
22245  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22246 
22247  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
22248  * # Check A
22249  * if A is None:
22250  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
22251  *
22252  * if A.ndim != 2:
22253  */
22254  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
22255  __Pyx_GOTREF(__pyx_tuple_);
22256  __Pyx_GIVEREF(__pyx_tuple_);
22257 
22258  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
22259  *
22260  * if A.ndim != 2:
22261  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
22262  *
22263  * # Data type
22264  */
22265  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
22266  __Pyx_GOTREF(__pyx_tuple__2);
22267  __Pyx_GIVEREF(__pyx_tuple__2);
22268 
22269  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
22270  *
22271  * else:
22272  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
22273  * '"float128".')
22274  *
22275  */
22276  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
22277  __Pyx_GOTREF(__pyx_tuple__3);
22278  __Pyx_GIVEREF(__pyx_tuple__3);
22279 
22280  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
22281  * A_is_row_major = 0
22282  * else:
22283  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
22284  *
22285  * # Declare memoryviews to get data pointer
22286  */
22287  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
22288  __Pyx_GOTREF(__pyx_tuple__5);
22289  __Pyx_GIVEREF(__pyx_tuple__5);
22290 
22291  /* "(tree fragment)":2
22292  * def __reduce_cython__(self):
22293  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22294  * def __setstate_cython__(self, __pyx_state):
22295  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22296  */
22297  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22298  __Pyx_GOTREF(__pyx_tuple__15);
22299  __Pyx_GIVEREF(__pyx_tuple__15);
22300 
22301  /* "(tree fragment)":4
22302  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22303  * def __setstate_cython__(self, __pyx_state):
22304  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22305  */
22306  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
22307  __Pyx_GOTREF(__pyx_tuple__17);
22308  __Pyx_GIVEREF(__pyx_tuple__17);
22309 
22310  /* "View.MemoryView":134
22311  *
22312  * if not self.ndim:
22313  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22314  *
22315  * if itemsize <= 0:
22316  */
22317  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
22318  __Pyx_GOTREF(__pyx_tuple__18);
22319  __Pyx_GIVEREF(__pyx_tuple__18);
22320 
22321  /* "View.MemoryView":137
22322  *
22323  * if itemsize <= 0:
22324  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22325  *
22326  * if not isinstance(format, bytes):
22327  */
22328  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
22329  __Pyx_GOTREF(__pyx_tuple__19);
22330  __Pyx_GIVEREF(__pyx_tuple__19);
22331 
22332  /* "View.MemoryView":149
22333  *
22334  * if not self._shape:
22335  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22336  *
22337  *
22338  */
22339  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
22340  __Pyx_GOTREF(__pyx_tuple__20);
22341  __Pyx_GIVEREF(__pyx_tuple__20);
22342 
22343  /* "View.MemoryView":177
22344  * self.data = <char *>malloc(self.len)
22345  * if not self.data:
22346  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22347  *
22348  * if self.dtype_is_object:
22349  */
22350  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
22351  __Pyx_GOTREF(__pyx_tuple__21);
22352  __Pyx_GIVEREF(__pyx_tuple__21);
22353 
22354  /* "View.MemoryView":193
22355  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22356  * if not (flags & bufmode):
22357  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22358  * info.buf = self.data
22359  * info.len = self.len
22360  */
22361  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
22362  __Pyx_GOTREF(__pyx_tuple__22);
22363  __Pyx_GIVEREF(__pyx_tuple__22);
22364 
22365  /* "(tree fragment)":2
22366  * def __reduce_cython__(self):
22367  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22368  * def __setstate_cython__(self, __pyx_state):
22369  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22370  */
22371  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22372  __Pyx_GOTREF(__pyx_tuple__23);
22373  __Pyx_GIVEREF(__pyx_tuple__23);
22374 
22375  /* "(tree fragment)":4
22376  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22377  * def __setstate_cython__(self, __pyx_state):
22378  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22379  */
22380  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22381  __Pyx_GOTREF(__pyx_tuple__24);
22382  __Pyx_GIVEREF(__pyx_tuple__24);
22383 
22384  /* "View.MemoryView":420
22385  * def __setitem__(memoryview self, object index, object value):
22386  * if self.view.readonly:
22387  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22388  *
22389  * have_slices, index = _unellipsify(index, self.view.ndim)
22390  */
22391  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
22392  __Pyx_GOTREF(__pyx_tuple__25);
22393  __Pyx_GIVEREF(__pyx_tuple__25);
22394 
22395  /* "View.MemoryView":497
22396  * result = struct.unpack(self.view.format, bytesitem)
22397  * except struct.error:
22398  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22399  * else:
22400  * if len(self.view.format) == 1:
22401  */
22402  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
22403  __Pyx_GOTREF(__pyx_tuple__26);
22404  __Pyx_GIVEREF(__pyx_tuple__26);
22405 
22406  /* "View.MemoryView":522
22407  * def __getbuffer__(self, Py_buffer *info, int flags):
22408  * if flags & PyBUF_WRITABLE and self.view.readonly:
22409  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22410  *
22411  * if flags & PyBUF_ND:
22412  */
22413  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
22414  __Pyx_GOTREF(__pyx_tuple__27);
22415  __Pyx_GIVEREF(__pyx_tuple__27);
22416 
22417  /* "View.MemoryView":572
22418  * if self.view.strides == NULL:
22419  *
22420  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22421  *
22422  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22423  */
22424  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
22425  __Pyx_GOTREF(__pyx_tuple__28);
22426  __Pyx_GIVEREF(__pyx_tuple__28);
22427 
22428  /* "View.MemoryView":579
22429  * def suboffsets(self):
22430  * if self.view.suboffsets == NULL:
22431  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22432  *
22433  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22434  */
22435  __pyx_tuple__29 = PyTuple_New(1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
22436  __Pyx_GOTREF(__pyx_tuple__29);
22437  __Pyx_INCREF(__pyx_int_neg_1);
22438  __Pyx_GIVEREF(__pyx_int_neg_1);
22439  PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22440  __Pyx_GIVEREF(__pyx_tuple__29);
22441 
22442  /* "(tree fragment)":2
22443  * def __reduce_cython__(self):
22444  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22445  * def __setstate_cython__(self, __pyx_state):
22446  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22447  */
22448  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22449  __Pyx_GOTREF(__pyx_tuple__30);
22450  __Pyx_GIVEREF(__pyx_tuple__30);
22451 
22452  /* "(tree fragment)":4
22453  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22454  * def __setstate_cython__(self, __pyx_state):
22455  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22456  */
22457  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22458  __Pyx_GOTREF(__pyx_tuple__31);
22459  __Pyx_GIVEREF(__pyx_tuple__31);
22460 
22461  /* "View.MemoryView":684
22462  * if item is Ellipsis:
22463  * if not seen_ellipsis:
22464  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22465  * seen_ellipsis = True
22466  * else:
22467  */
22468  __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
22469  __Pyx_GOTREF(__pyx_slice__32);
22470  __Pyx_GIVEREF(__pyx_slice__32);
22471 
22472  /* "View.MemoryView":705
22473  * for suboffset in suboffsets[:ndim]:
22474  * if suboffset >= 0:
22475  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22476  *
22477  *
22478  */
22479  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
22480  __Pyx_GOTREF(__pyx_tuple__33);
22481  __Pyx_GIVEREF(__pyx_tuple__33);
22482 
22483  /* "(tree fragment)":2
22484  * def __reduce_cython__(self):
22485  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22486  * def __setstate_cython__(self, __pyx_state):
22487  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22488  */
22489  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22490  __Pyx_GOTREF(__pyx_tuple__34);
22491  __Pyx_GIVEREF(__pyx_tuple__34);
22492 
22493  /* "(tree fragment)":4
22494  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22495  * def __setstate_cython__(self, __pyx_state):
22496  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22497  */
22498  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22499  __Pyx_GOTREF(__pyx_tuple__35);
22500  __Pyx_GIVEREF(__pyx_tuple__35);
22501  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
22502  __Pyx_GOTREF(__pyx_tuple__37);
22503  __Pyx_GIVEREF(__pyx_tuple__37);
22504 
22505  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
22506  * # ======================
22507  *
22508  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
22509  * """
22510  * Sets matrix A.
22511  */
22512  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 216, __pyx_L1_error)
22513  __Pyx_GOTREF(__pyx_tuple__38);
22514  __Pyx_GIVEREF(__pyx_tuple__38);
22515  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22516 
22517  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
22518  * # =======================
22519  *
22520  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
22521  * """
22522  * Sets matrix A.
22523  */
22524  __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 272, __pyx_L1_error)
22525  __Pyx_GOTREF(__pyx_tuple__39);
22526  __Pyx_GIVEREF(__pyx_tuple__39);
22527  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22528 
22529  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
22530  * # ============================
22531  *
22532  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22533  * """
22534  * Sets matrix A.
22535  */
22536  __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 328, __pyx_L1_error)
22537  __Pyx_GOTREF(__pyx_tuple__40);
22538  __Pyx_GIVEREF(__pyx_tuple__40);
22539  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22540 
22541  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
22542  * # ====================
22543  *
22544  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
22545  * """
22546  * """
22547  */
22548  __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 384, __pyx_L1_error)
22549  __Pyx_GOTREF(__pyx_tuple__41);
22550  __Pyx_GIVEREF(__pyx_tuple__41);
22551  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22552 
22553  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
22554  * # =====================
22555  *
22556  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
22557  * """
22558  * """
22559  */
22560  __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 431, __pyx_L1_error)
22561  __Pyx_GOTREF(__pyx_tuple__42);
22562  __Pyx_GIVEREF(__pyx_tuple__42);
22563  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22564 
22565  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
22566  * # ==========================
22567  *
22568  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22569  * """
22570  * """
22571  */
22572  __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 478, __pyx_L1_error)
22573  __Pyx_GOTREF(__pyx_tuple__43);
22574  __Pyx_GIVEREF(__pyx_tuple__43);
22575  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22576 
22577  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
22578  * # ====================
22579  *
22580  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
22581  * """
22582  * """
22583  */
22584  __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 525, __pyx_L1_error)
22585  __Pyx_GOTREF(__pyx_tuple__44);
22586  __Pyx_GIVEREF(__pyx_tuple__44);
22587  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22588 
22589  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
22590  * # =====================
22591  *
22592  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
22593  * """
22594  * """
22595  */
22596  __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 572, __pyx_L1_error)
22597  __Pyx_GOTREF(__pyx_tuple__45);
22598  __Pyx_GIVEREF(__pyx_tuple__45);
22599  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22600 
22601  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
22602  * # ==========================
22603  *
22604  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22605  * """
22606  * """
22607  */
22608  __pyx_tuple__46 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 619, __pyx_L1_error)
22609  __Pyx_GOTREF(__pyx_tuple__46);
22610  __Pyx_GIVEREF(__pyx_tuple__46);
22611  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22612 
22613  /* "(tree fragment)":1
22614  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22615  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22616  * def __setstate_cython__(self, __pyx_state):
22617  */
22618  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
22619  __Pyx_GOTREF(__pyx_tuple__47);
22620  __Pyx_GIVEREF(__pyx_tuple__47);
22621  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22622 
22623  /* "(tree fragment)":3
22624  * def __reduce_cython__(self):
22625  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22626  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22627  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22628  */
22629  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 3, __pyx_L1_error)
22630  __Pyx_GOTREF(__pyx_tuple__48);
22631  __Pyx_GIVEREF(__pyx_tuple__48);
22632  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22633 
22634  /* "View.MemoryView":287
22635  * return self.name
22636  *
22637  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22638  * cdef strided = Enum("<strided and direct>") # default
22639  * cdef indirect = Enum("<strided and indirect>")
22640  */
22641  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22642  __Pyx_GOTREF(__pyx_tuple__49);
22643  __Pyx_GIVEREF(__pyx_tuple__49);
22644 
22645  /* "View.MemoryView":288
22646  *
22647  * cdef generic = Enum("<strided and direct or indirect>")
22648  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22649  * cdef indirect = Enum("<strided and indirect>")
22650  *
22651  */
22652  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22653  __Pyx_GOTREF(__pyx_tuple__50);
22654  __Pyx_GIVEREF(__pyx_tuple__50);
22655 
22656  /* "View.MemoryView":289
22657  * cdef generic = Enum("<strided and direct or indirect>")
22658  * cdef strided = Enum("<strided and direct>") # default
22659  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22660  *
22661  *
22662  */
22663  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 289, __pyx_L1_error)
22664  __Pyx_GOTREF(__pyx_tuple__51);
22665  __Pyx_GIVEREF(__pyx_tuple__51);
22666 
22667  /* "View.MemoryView":292
22668  *
22669  *
22670  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22671  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22672  *
22673  */
22674  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22675  __Pyx_GOTREF(__pyx_tuple__52);
22676  __Pyx_GIVEREF(__pyx_tuple__52);
22677 
22678  /* "View.MemoryView":293
22679  *
22680  * cdef contiguous = Enum("<contiguous and direct>")
22681  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22682  *
22683  *
22684  */
22685  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 293, __pyx_L1_error)
22686  __Pyx_GOTREF(__pyx_tuple__53);
22687  __Pyx_GIVEREF(__pyx_tuple__53);
22688 
22689  /* "(tree fragment)":1
22690  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22691  * cdef object __pyx_PickleError
22692  * cdef object __pyx_result
22693  */
22694  __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
22695  __Pyx_GOTREF(__pyx_tuple__54);
22696  __Pyx_GIVEREF(__pyx_tuple__54);
22697  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22698  __Pyx_RefNannyFinishContext();
22699  return 0;
22700  __pyx_L1_error:;
22701  __Pyx_RefNannyFinishContext();
22702  return -1;
22703 }
22704 
22705 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22706  /* AssertionsEnabled.init */
22707  __Pyx_init_assertions_enabled();
22708 
22709 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
22710 
22711  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22712  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22713  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22714  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22715  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22716  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22717  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22718  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22719  return 0;
22720  __pyx_L1_error:;
22721  return -1;
22722 }
22723 
22724 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22725 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22726 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22727 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22728 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22729 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22730 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22731 
22732 static int __Pyx_modinit_global_init_code(void) {
22733  __Pyx_RefNannyDeclarations
22734  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22735  /*--- Global init code ---*/
22736  generic = Py_None; Py_INCREF(Py_None);
22737  strided = Py_None; Py_INCREF(Py_None);
22738  indirect = Py_None; Py_INCREF(Py_None);
22739  contiguous = Py_None; Py_INCREF(Py_None);
22740  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22741  __Pyx_RefNannyFinishContext();
22742  return 0;
22743 }
22744 
22745 static int __Pyx_modinit_variable_export_code(void) {
22746  __Pyx_RefNannyDeclarations
22747  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22748  /*--- Variable export code ---*/
22749  __Pyx_RefNannyFinishContext();
22750  return 0;
22751 }
22752 
22753 static int __Pyx_modinit_function_export_code(void) {
22754  __Pyx_RefNannyDeclarations
22755  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22756  /*--- Function export code ---*/
22757  __Pyx_RefNannyFinishContext();
22758  return 0;
22759 }
22760 
22761 static int __Pyx_modinit_type_init_code(void) {
22762  __Pyx_RefNannyDeclarations
22763  PyObject *__pyx_t_1 = NULL;
22764  int __pyx_lineno = 0;
22765  const char *__pyx_filename = NULL;
22766  int __pyx_clineno = 0;
22767  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22768  /*--- Type init code ---*/
22769  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22770  __Pyx_GOTREF(__pyx_t_1);
22771  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22772  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22773  __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22774  __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22775  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22776  if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22777  #if PY_VERSION_HEX < 0x030800B1
22778  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22779  #endif
22780  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22781  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22782  }
22783  if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22784  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22785  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22786  __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22787  __pyx_vtabptr_array = &__pyx_vtable_array;
22788  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22789  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22790  #if PY_VERSION_HEX < 0x030800B1
22791  __pyx_type___pyx_array.tp_print = 0;
22792  #endif
22793  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22794  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22795  __pyx_array_type = &__pyx_type___pyx_array;
22796  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22797  #if PY_VERSION_HEX < 0x030800B1
22798  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22799  #endif
22800  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22801  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22802  }
22803  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22804  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22805  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22806  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22807  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22808  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22809  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22810  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22811  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22812  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22813  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22814  #if PY_VERSION_HEX < 0x030800B1
22815  __pyx_type___pyx_memoryview.tp_print = 0;
22816  #endif
22817  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22818  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22819  }
22820  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22821  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22822  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22823  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22824  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22825  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22826  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22827  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22828  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22829  #if PY_VERSION_HEX < 0x030800B1
22830  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22831  #endif
22832  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22833  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22834  }
22835  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22836  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22837  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22839  __Pyx_RefNannyFinishContext();
22840  return 0;
22841  __pyx_L1_error:;
22842  __Pyx_XDECREF(__pyx_t_1);
22843  __Pyx_RefNannyFinishContext();
22844  return -1;
22845 }
22846 
22847 static int __Pyx_modinit_type_import_code(void) {
22848  __Pyx_RefNannyDeclarations
22849  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22850  /*--- Type import code ---*/
22851  __Pyx_RefNannyFinishContext();
22852  return 0;
22853 }
22854 
22855 static int __Pyx_modinit_variable_import_code(void) {
22856  __Pyx_RefNannyDeclarations
22857  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22858  /*--- Variable import code ---*/
22859  __Pyx_RefNannyFinishContext();
22860  return 0;
22861 }
22862 
22863 static int __Pyx_modinit_function_import_code(void) {
22864  __Pyx_RefNannyDeclarations
22865  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22866  /*--- Function import code ---*/
22867  __Pyx_RefNannyFinishContext();
22868  return 0;
22869 }
22870 
22871 
22872 #ifndef CYTHON_NO_PYINIT_EXPORT
22873 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22874 #elif PY_MAJOR_VERSION < 3
22875 #ifdef __cplusplus
22876 #define __Pyx_PyMODINIT_FUNC extern "C" void
22877 #else
22878 #define __Pyx_PyMODINIT_FUNC void
22879 #endif
22880 #else
22881 #ifdef __cplusplus
22882 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22883 #else
22884 #define __Pyx_PyMODINIT_FUNC PyObject *
22885 #endif
22886 #endif
22887 
22888 
22889 #if PY_MAJOR_VERSION < 3
22890 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22891 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void)
22892 #else
22893 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22894 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)
22895 #if CYTHON_PEP489_MULTI_PHASE_INIT
22896 {
22897  return PyModuleDef_Init(&__pyx_moduledef);
22898 }
22899 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
22900  #if PY_VERSION_HEX >= 0x030700A1
22901  static PY_INT64_T main_interpreter_id = -1;
22902  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22903  if (main_interpreter_id == -1) {
22904  main_interpreter_id = current_id;
22905  return (unlikely(current_id == -1)) ? -1 : 0;
22906  } else if (unlikely(main_interpreter_id != current_id))
22907  #else
22908  static PyInterpreterState *main_interpreter = NULL;
22909  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22910  if (!main_interpreter) {
22911  main_interpreter = current_interpreter;
22912  } else if (unlikely(main_interpreter != current_interpreter))
22913  #endif
22914  {
22915  PyErr_SetString(
22916  PyExc_ImportError,
22917  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22918  return -1;
22919  }
22920  return 0;
22921 }
22922 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
22923  PyObject *value = PyObject_GetAttrString(spec, from_name);
22924  int result = 0;
22925  if (likely(value)) {
22926  if (allow_none || value != Py_None) {
22927  result = PyDict_SetItemString(moddict, to_name, value);
22928  }
22929  Py_DECREF(value);
22930  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22931  PyErr_Clear();
22932  } else {
22933  result = -1;
22934  }
22935  return result;
22936 }
22937 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22938  PyObject *module = NULL, *moddict, *modname;
22939  if (__Pyx_check_single_interpreter())
22940  return NULL;
22941  if (__pyx_m)
22942  return __Pyx_NewRef(__pyx_m);
22943  modname = PyObject_GetAttrString(spec, "name");
22944  if (unlikely(!modname)) goto bad;
22945  module = PyModule_NewObject(modname);
22946  Py_DECREF(modname);
22947  if (unlikely(!module)) goto bad;
22948  moddict = PyModule_GetDict(module);
22949  if (unlikely(!moddict)) goto bad;
22950  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
22951  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
22952  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
22953  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
22954  return module;
22955 bad:
22956  Py_XDECREF(module);
22957  return NULL;
22958 }
22959 
22960 
22961 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22962 #endif
22963 #endif
22964 {
22965  __Pyx_TraceDeclarations
22966  PyObject *__pyx_t_1 = NULL;
22967  PyObject *__pyx_t_2 = NULL;
22968  static PyThread_type_lock __pyx_t_3[8];
22969  int __pyx_lineno = 0;
22970  const char *__pyx_filename = NULL;
22971  int __pyx_clineno = 0;
22972  __Pyx_RefNannyDeclarations
22973  #if CYTHON_PEP489_MULTI_PHASE_INIT
22974  if (__pyx_m) {
22975  if (__pyx_m == __pyx_pyinit_module) return 0;
22976  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22977  return -1;
22978  }
22979  #elif PY_MAJOR_VERSION >= 3
22980  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22981  #endif
22982  #if CYTHON_REFNANNY
22983 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22984 if (!__Pyx_RefNanny) {
22985  PyErr_Clear();
22986  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22987  if (!__Pyx_RefNanny)
22988  Py_FatalError("failed to import 'refnanny' module");
22989 }
22990 #endif
22991  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22992  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22993  #ifdef __Pxy_PyFrame_Initialize_Offsets
22994  __Pxy_PyFrame_Initialize_Offsets();
22995  #endif
22996  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22997  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22998  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22999  #ifdef __Pyx_CyFunction_USED
23000  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23001  #endif
23002  #ifdef __Pyx_FusedFunction_USED
23003  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23004  #endif
23005  #ifdef __Pyx_Coroutine_USED
23006  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23007  #endif
23008  #ifdef __Pyx_Generator_USED
23009  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23010  #endif
23011  #ifdef __Pyx_AsyncGen_USED
23012  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23013  #endif
23014  #ifdef __Pyx_StopAsyncIteration_USED
23015  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23016  #endif
23017  /*--- Library function declarations ---*/
23018  /*--- Threads initialization code ---*/
23019  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23020  PyEval_InitThreads();
23021  #endif
23022  /*--- Module creation code ---*/
23023  #if CYTHON_PEP489_MULTI_PHASE_INIT
23024  __pyx_m = __pyx_pyinit_module;
23025  Py_INCREF(__pyx_m);
23026  #else
23027  #if PY_MAJOR_VERSION < 3
23028  __pyx_m = Py_InitModule4("py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23029  #else
23030  __pyx_m = PyModule_Create(&__pyx_moduledef);
23031  #endif
23032  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23033  #endif
23034  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23035  Py_INCREF(__pyx_d);
23036  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23037  Py_INCREF(__pyx_b);
23038  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23039  Py_INCREF(__pyx_cython_runtime);
23040  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23041  /*--- Initialize various global constants etc. ---*/
23042  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23043  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23044  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23045  #endif
23046  if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
23047  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23048  }
23049  #if PY_MAJOR_VERSION >= 3
23050  {
23051  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23052  if (!PyDict_GetItemString(modules, "imate._c_linear_operator.py_c_matrix")) {
23053  if (unlikely(PyDict_SetItemString(modules, "imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23054  }
23055  }
23056  #endif
23057  /*--- Builtin init code ---*/
23058  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23059  /*--- Constants init code ---*/
23060  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23061  /*--- Global type/function init code ---*/
23062  (void)__Pyx_modinit_global_init_code();
23063  (void)__Pyx_modinit_variable_export_code();
23064  (void)__Pyx_modinit_function_export_code();
23065  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23066  (void)__Pyx_modinit_type_import_code();
23067  (void)__Pyx_modinit_variable_import_code();
23068  (void)__Pyx_modinit_function_import_code();
23069  /*--- Execution code ---*/
23070  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23071  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23072  #endif
23073  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23074 
23075  /* "imate/_c_linear_operator/py_c_matrix.pyx":15
23076  *
23077  * # Python
23078  * import numpy # <<<<<<<<<<<<<<
23079  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix
23080  *
23081  */
23082  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
23083  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
23084  __Pyx_GOTREF(__pyx_t_1);
23085  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
23086  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23087 
23088  /* "imate/_c_linear_operator/py_c_matrix.pyx":16
23089  * # Python
23090  * import numpy
23091  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix # <<<<<<<<<<<<<<
23092  *
23093  * # Cython
23094  */
23095  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
23096  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23097  __Pyx_GOTREF(__pyx_t_1);
23098  __Pyx_INCREF(__pyx_n_s_issparse);
23099  __Pyx_GIVEREF(__pyx_n_s_issparse);
23100  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
23101  __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
23102  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
23103  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
23104  __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
23105  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
23106  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
23107  __Pyx_INCREF(__pyx_n_s_csr_matrix);
23108  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
23109  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
23110  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
23111  __Pyx_GOTREF(__pyx_t_2);
23112  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23113  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23114  __Pyx_GOTREF(__pyx_t_1);
23115  if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23116  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23117  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23118  __Pyx_GOTREF(__pyx_t_1);
23119  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23120  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23121  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23122  __Pyx_GOTREF(__pyx_t_1);
23123  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23124  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23125  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23126  __Pyx_GOTREF(__pyx_t_1);
23127  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23128  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23129  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23130 
23131  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
23132  * # ======================
23133  *
23134  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
23135  * """
23136  * Sets matrix A.
23137  */
23138  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
23139  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
23140  __Pyx_GOTREF(__pyx_t_2);
23141  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
23142  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23143  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23144 
23145  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
23146  * # =======================
23147  *
23148  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
23149  * """
23150  * Sets matrix A.
23151  */
23152  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
23153  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
23154  __Pyx_GOTREF(__pyx_t_2);
23155  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
23156  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23157  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23158 
23159  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
23160  * # ============================
23161  *
23162  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23163  * """
23164  * Sets matrix A.
23165  */
23166  __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
23167  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
23168  __Pyx_GOTREF(__pyx_t_2);
23169  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
23170  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23171  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23172 
23173  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
23174  * # ====================
23175  *
23176  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
23177  * """
23178  * """
23179  */
23180  __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
23181  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
23182  __Pyx_GOTREF(__pyx_t_2);
23183  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
23184  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23185  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23186 
23187  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
23188  * # =====================
23189  *
23190  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
23191  * """
23192  * """
23193  */
23194  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
23195  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
23196  __Pyx_GOTREF(__pyx_t_2);
23197  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
23198  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23199  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23200 
23201  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
23202  * # ==========================
23203  *
23204  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23205  * """
23206  * """
23207  */
23208  __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
23209  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
23210  __Pyx_GOTREF(__pyx_t_2);
23211  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
23212  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23213  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23214 
23215  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
23216  * # ====================
23217  *
23218  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
23219  * """
23220  * """
23221  */
23222  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
23223  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
23224  __Pyx_GOTREF(__pyx_t_2);
23225  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
23226  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23227  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23228 
23229  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
23230  * # =====================
23231  *
23232  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
23233  * """
23234  * """
23235  */
23236  __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
23237  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
23238  __Pyx_GOTREF(__pyx_t_2);
23239  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
23240  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23241  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23242 
23243  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
23244  * # ==========================
23245  *
23246  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
23247  * """
23248  * """
23249  */
23250  __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
23251  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
23252  __Pyx_GOTREF(__pyx_t_2);
23253  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
23254  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23255  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23256 
23257  /* "(tree fragment)":1
23258  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23259  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23260  * def __setstate_cython__(self, __pyx_state):
23261  */
23262  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23263  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23264  __Pyx_GOTREF(__pyx_t_2);
23265  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23266  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23267 
23268  /* "(tree fragment)":3
23269  * def __reduce_cython__(self):
23270  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23271  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23272  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23273  */
23274  __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
23275  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
23276  __Pyx_GOTREF(__pyx_t_2);
23277  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23278  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23279 
23280  /* "imate/_c_linear_operator/py_c_matrix.pyx":1
23281  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
23282  * # SPDX-License-Identifier: BSD-3-Clause
23283  * # SPDX-FileType: SOURCE
23284  */
23285  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
23286  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23287  __Pyx_GOTREF(__pyx_t_2);
23288  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23289  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23290 
23291  /* "View.MemoryView":210
23292  * info.obj = self
23293  *
23294  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23295  *
23296  * def __dealloc__(array self):
23297  */
23298  __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
23299  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
23300  __Pyx_GOTREF(__pyx_t_2);
23301  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
23302  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23303  PyType_Modified(__pyx_array_type);
23304 
23305  /* "View.MemoryView":227
23306  *
23307  * @cname('get_memview')
23308  * cdef get_memview(self): # <<<<<<<<<<<<<<
23309  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
23310  * return memoryview(self, flags, self.dtype_is_object)
23311  */
23312  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
23313 
23314 
23315  /* "View.MemoryView":245
23316  *
23317  * @cname("__pyx_array_new")
23318  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
23319  * char *mode, char *buf):
23320  * cdef array result
23321  */
23322  __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
23323 
23324 
23325  /* "View.MemoryView":287
23326  * return self.name
23327  *
23328  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23329  * cdef strided = Enum("<strided and direct>") # default
23330  * cdef indirect = Enum("<strided and indirect>")
23331  */
23332  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
23333  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
23334  __Pyx_GOTREF(__pyx_t_2);
23335  __Pyx_XGOTREF(generic);
23336  __Pyx_DECREF_SET(generic, __pyx_t_2);
23337  __Pyx_GIVEREF(__pyx_t_2);
23338  __pyx_t_2 = 0;
23339 
23340  /* "View.MemoryView":288
23341  *
23342  * cdef generic = Enum("<strided and direct or indirect>")
23343  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23344  * cdef indirect = Enum("<strided and indirect>")
23345  *
23346  */
23347  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23348  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23349  __Pyx_GOTREF(__pyx_t_2);
23350  __Pyx_XGOTREF(strided);
23351  __Pyx_DECREF_SET(strided, __pyx_t_2);
23352  __Pyx_GIVEREF(__pyx_t_2);
23353  __pyx_t_2 = 0;
23354 
23355  /* "View.MemoryView":289
23356  * cdef generic = Enum("<strided and direct or indirect>")
23357  * cdef strided = Enum("<strided and direct>") # default
23358  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23359  *
23360  *
23361  */
23362  __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
23363  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
23364  __Pyx_GOTREF(__pyx_t_2);
23365  __Pyx_XGOTREF(indirect);
23366  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23367  __Pyx_GIVEREF(__pyx_t_2);
23368  __pyx_t_2 = 0;
23369 
23370  /* "View.MemoryView":292
23371  *
23372  *
23373  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23374  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23375  *
23376  */
23377  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23378  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23379  __Pyx_GOTREF(__pyx_t_2);
23380  __Pyx_XGOTREF(contiguous);
23381  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23382  __Pyx_GIVEREF(__pyx_t_2);
23383  __pyx_t_2 = 0;
23384 
23385  /* "View.MemoryView":293
23386  *
23387  * cdef contiguous = Enum("<contiguous and direct>")
23388  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23389  *
23390  *
23391  */
23392  __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
23393  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
23394  __Pyx_GOTREF(__pyx_t_2);
23395  __Pyx_XGOTREF(indirect_contiguous);
23396  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23397  __Pyx_GIVEREF(__pyx_t_2);
23398  __pyx_t_2 = 0;
23399 
23400  /* "View.MemoryView":299
23401  *
23402  * @cname('__pyx_align_pointer')
23403  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
23404  * "Align pointer memory on a given boundary"
23405  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
23406  */
23407  __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
23408 
23409 
23410  /* "View.MemoryView":317
23411  *
23412  * DEF THREAD_LOCKS_PREALLOCATED = 8
23413  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23414  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23415  * PyThread_allocate_lock(),
23416  */
23417  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23418  __pyx_memoryview_thread_locks_used = 0;
23419 
23420  /* "View.MemoryView":318
23421  * DEF THREAD_LOCKS_PREALLOCATED = 8
23422  * cdef int __pyx_memoryview_thread_locks_used = 0
23423  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23424  * PyThread_allocate_lock(),
23425  * PyThread_allocate_lock(),
23426  */
23427  __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
23428  __pyx_t_3[0] = PyThread_allocate_lock();
23429  __pyx_t_3[1] = PyThread_allocate_lock();
23430  __pyx_t_3[2] = PyThread_allocate_lock();
23431  __pyx_t_3[3] = PyThread_allocate_lock();
23432  __pyx_t_3[4] = PyThread_allocate_lock();
23433  __pyx_t_3[5] = PyThread_allocate_lock();
23434  __pyx_t_3[6] = PyThread_allocate_lock();
23435  __pyx_t_3[7] = PyThread_allocate_lock();
23436  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23437 
23438  /* "View.MemoryView":395
23439  * PyThread_free_lock(self.lock)
23440  *
23441  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
23442  * cdef Py_ssize_t dim
23443  * cdef char *itemp = <char *> self.view.buf
23444  */
23445  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
23446 
23447 
23448  /* "View.MemoryView":433
23449  * self.setitem_indexed(index, value)
23450  *
23451  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
23452  * if not isinstance(obj, memoryview):
23453  * try:
23454  */
23455  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
23456 
23457 
23458  /* "View.MemoryView":443
23459  * return obj
23460  *
23461  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
23462  * cdef __Pyx_memviewslice dst_slice
23463  * cdef __Pyx_memviewslice src_slice
23464  */
23465  __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
23466 
23467 
23468  /* "View.MemoryView":451
23469  * src.ndim, dst.ndim, self.dtype_is_object)
23470  *
23471  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
23472  * cdef int array[128]
23473  * cdef void *tmp = NULL
23474  */
23475  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
23476 
23477 
23478  /* "View.MemoryView":483
23479  * PyMem_Free(tmp)
23480  *
23481  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
23482  * cdef char *itemp = self.get_item_pointer(index)
23483  * self.assign_item_from_object(itemp, value)
23484  */
23485  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
23486 
23487 
23488  /* "View.MemoryView":487
23489  * self.assign_item_from_object(itemp, value)
23490  *
23491  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23492  * """Only used if instantiated manually by the user, or if Cython doesn't
23493  * know how to convert the type"""
23494  */
23495  __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
23496 
23497 
23498  /* "View.MemoryView":503
23499  * return result
23500  *
23501  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23502  * """Only used if instantiated manually by the user, or if Cython doesn't
23503  * know how to convert the type"""
23504  */
23505  __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
23506 
23507 
23508  /* "View.MemoryView":551
23509  * info.obj = self
23510  *
23511  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23512  *
23513  *
23514  */
23515  __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
23516  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
23517  __Pyx_GOTREF(__pyx_t_2);
23518  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
23519  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23520  PyType_Modified(__pyx_memoryview_type);
23521 
23522  /* "View.MemoryView":659
23523  *
23524  * @cname('__pyx_memoryview_new')
23525  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
23526  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
23527  * result.typeinfo = typeinfo
23528  */
23529  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
23530 
23531 
23532  /* "View.MemoryView":665
23533  *
23534  * @cname('__pyx_memoryview_check')
23535  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
23536  * return isinstance(o, memoryview)
23537  *
23538  */
23539  __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
23540 
23541 
23542  /* "View.MemoryView":668
23543  * return isinstance(o, memoryview)
23544  *
23545  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
23546  * """
23547  * Replace all ellipses with full slices and fill incomplete indices with
23548  */
23549  __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
23550 
23551 
23552  /* "View.MemoryView":702
23553  * return have_slices or nslices, tuple(result)
23554  *
23555  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
23556  * for suboffset in suboffsets[:ndim]:
23557  * if suboffset >= 0:
23558  */
23559  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
23560 
23561 
23562  /* "View.MemoryView":712
23563  *
23564  * @cname('__pyx_memview_slice')
23565  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
23566  * cdef int new_ndim = 0, suboffset_dim = -1, dim
23567  * cdef bint negative_step
23568  */
23569  __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
23570 
23571 
23572  /* "View.MemoryView":809
23573  *
23574  * @cname('__pyx_memoryview_slice_memviewslice')
23575  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
23576  * __Pyx_memviewslice *dst,
23577  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
23578  */
23579  __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
23580 
23581 
23582  /* "View.MemoryView":912
23583  *
23584  * @cname('__pyx_pybuffer_index')
23585  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
23586  * Py_ssize_t dim) except NULL:
23587  * cdef Py_ssize_t shape, stride, suboffset = -1
23588  */
23589  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
23590 
23591 
23592  /* "View.MemoryView":945
23593  *
23594  * @cname('__pyx_memslice_transpose')
23595  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
23596  * cdef int ndim = memslice.memview.view.ndim
23597  *
23598  */
23599  __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
23600 
23601 
23602  /* "View.MemoryView":981
23603  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
23604  *
23605  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23606  * if self.to_object_func != NULL:
23607  * return self.to_object_func(itemp)
23608  */
23609  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
23610 
23611 
23612  /* "View.MemoryView":987
23613  * return memoryview.convert_item_to_object(self, itemp)
23614  *
23615  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23616  * if self.to_dtype_func != NULL:
23617  * self.to_dtype_func(itemp, value)
23618  */
23619  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
23620 
23621 
23622  /* "View.MemoryView":997
23623  * return self.from_object
23624  *
23625  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23626  *
23627  *
23628  */
23629  __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
23630  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
23631  __Pyx_GOTREF(__pyx_t_2);
23632  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
23633  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23634  PyType_Modified(__pyx_memoryviewslice_type);
23635 
23636  /* "View.MemoryView":1001
23637  *
23638  * @cname('__pyx_memoryview_fromslice')
23639  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
23640  * int ndim,
23641  * object (*to_object_func)(char *),
23642  */
23643  __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
23644 
23645 
23646  /* "View.MemoryView":1054
23647  *
23648  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23649  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
23650  * __Pyx_memviewslice *mslice) except NULL:
23651  * cdef _memoryviewslice obj
23652  */
23653  __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
23654 
23655 
23656  /* "View.MemoryView":1065
23657  *
23658  * @cname('__pyx_memoryview_slice_copy')
23659  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
23660  * cdef int dim
23661  * cdef (Py_ssize_t*) shape, strides, suboffsets
23662  */
23663  __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
23664 
23665 
23666  /* "View.MemoryView":1082
23667  *
23668  * @cname('__pyx_memoryview_copy_object')
23669  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
23670  * "Create a new memoryview object"
23671  * cdef __Pyx_memviewslice memviewslice
23672  */
23673  __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
23674 
23675 
23676  /* "View.MemoryView":1089
23677  *
23678  * @cname('__pyx_memoryview_copy_object_from_slice')
23679  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
23680  * """
23681  * Create a new memoryview object from a given memoryview object and slice.
23682  */
23683  __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
23684 
23685 
23686  /* "View.MemoryView":1111
23687  *
23688  *
23689  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
23690  * if arg < 0:
23691  * return -arg
23692  */
23693  __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
23694 
23695 
23696  /* "View.MemoryView":1118
23697  *
23698  * @cname('__pyx_get_best_slice_order')
23699  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
23700  * """
23701  * Figure out the best memory access order for a given slice.
23702  */
23703  __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
23704 
23705 
23706  /* "View.MemoryView":1172
23707  * dst_data += dst_stride
23708  *
23709  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23710  * __Pyx_memviewslice *dst,
23711  * int ndim, size_t itemsize) nogil:
23712  */
23713  __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
23714 
23715 
23716  /* "View.MemoryView":1179
23717  *
23718  * @cname('__pyx_memoryview_slice_get_size')
23719  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
23720  * "Return the size of the memory occupied by the slice in number of bytes"
23721  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23722  */
23723  __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
23724 
23725 
23726  /* "View.MemoryView":1189
23727  *
23728  * @cname('__pyx_fill_contig_strides_array')
23729  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23730  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23731  * int ndim, char order) nogil:
23732  */
23733  __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
23734 
23735 
23736  /* "View.MemoryView":1210
23737  *
23738  * @cname('__pyx_memoryview_copy_data_to_temp')
23739  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23740  * __Pyx_memviewslice *tmpslice,
23741  * char order,
23742  */
23743  __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
23744 
23745 
23746  /* "View.MemoryView":1253
23747  *
23748  * @cname('__pyx_memoryview_err_extents')
23749  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23750  * Py_ssize_t extent2) except -1 with gil:
23751  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23752  */
23753  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23754 
23755 
23756  /* "View.MemoryView":1259
23757  *
23758  * @cname('__pyx_memoryview_err_dim')
23759  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23760  * raise error(msg.decode('ascii') % dim)
23761  *
23762  */
23763  __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
23764 
23765 
23766  /* "View.MemoryView":1263
23767  *
23768  * @cname('__pyx_memoryview_err')
23769  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23770  * if msg != NULL:
23771  * raise error(msg.decode('ascii'))
23772  */
23773  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23774 
23775 
23776  /* "View.MemoryView":1270
23777  *
23778  * @cname('__pyx_memoryview_copy_contents')
23779  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
23780  * __Pyx_memviewslice dst,
23781  * int src_ndim, int dst_ndim,
23782  */
23783  __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
23784 
23785 
23786  /* "View.MemoryView":1342
23787  *
23788  * @cname('__pyx_memoryview_broadcast_leading')
23789  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
23790  * int ndim,
23791  * int ndim_other) nogil:
23792  */
23793  __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
23794 
23795 
23796  /* "View.MemoryView":1364
23797  *
23798  * @cname('__pyx_memoryview_refcount_copying')
23799  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
23800  * int ndim, bint inc) nogil:
23801  *
23802  */
23803  __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
23804 
23805 
23806  /* "View.MemoryView":1373
23807  *
23808  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23809  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23810  * Py_ssize_t *strides, int ndim,
23811  * bint inc) with gil:
23812  */
23813  __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
23814 
23815 
23816  /* "View.MemoryView":1379
23817  *
23818  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23819  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23820  * Py_ssize_t *strides, int ndim, bint inc):
23821  * cdef Py_ssize_t i
23822  */
23823  __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
23824 
23825 
23826  /* "View.MemoryView":1399
23827  *
23828  * @cname('__pyx_memoryview_slice_assign_scalar')
23829  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
23830  * size_t itemsize, void *item,
23831  * bint dtype_is_object) nogil:
23832  */
23833  __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
23834 
23835 
23836  /* "View.MemoryView":1409
23837  *
23838  * @cname('__pyx_memoryview__slice_assign_scalar')
23839  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23840  * Py_ssize_t *strides, int ndim,
23841  * size_t itemsize, void *item) nogil:
23842  */
23843  __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
23844 
23845 
23846  /* "(tree fragment)":1
23847  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23848  * cdef object __pyx_PickleError
23849  * cdef object __pyx_result
23850  */
23851  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23852  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23853  __Pyx_GOTREF(__pyx_t_2);
23854  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23855  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23856 
23857  /* "(tree fragment)":11
23858  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23859  * return __pyx_result
23860  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23861  * __pyx_result.name = __pyx_state[0]
23862  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23863  */
23864  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23865 
23866  __Pyx_TraceReturn(Py_None, 0);
23867 
23868  /*--- Wrapped vars code ---*/
23869 
23870  goto __pyx_L0;
23871  __pyx_L1_error:;
23872  __Pyx_XDECREF(__pyx_t_1);
23873  __Pyx_XDECREF(__pyx_t_2);
23874  if (__pyx_m) {
23875  if (__pyx_d) {
23876  __Pyx_AddTraceback("init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23877  }
23878  Py_CLEAR(__pyx_m);
23879  } else if (!PyErr_Occurred()) {
23880  PyErr_SetString(PyExc_ImportError, "init imate._c_linear_operator.py_c_matrix");
23881  }
23882  __pyx_L0:;
23883  __Pyx_RefNannyFinishContext();
23884  #if CYTHON_PEP489_MULTI_PHASE_INIT
23885  return (__pyx_m != NULL) ? 0 : -1;
23886  #elif PY_MAJOR_VERSION >= 3
23887  return __pyx_m;
23888  #else
23889  return;
23890  #endif
23891 }
23892 
23893 /* --- Runtime support code --- */
23894 /* Refnanny */
23895 #if CYTHON_REFNANNY
23896 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23897  PyObject *m = NULL, *p = NULL;
23898  void *r = NULL;
23899  m = PyImport_ImportModule(modname);
23900  if (!m) goto end;
23901  p = PyObject_GetAttrString(m, "RefNannyAPI");
23902  if (!p) goto end;
23903  r = PyLong_AsVoidPtr(p);
23904 end:
23905  Py_XDECREF(p);
23906  Py_XDECREF(m);
23907  return (__Pyx_RefNannyAPIStruct *)r;
23908 }
23909 #endif
23910 
23911 /* PyObjectGetAttrStr */
23912 #if CYTHON_USE_TYPE_SLOTS
23913 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23914  PyTypeObject* tp = Py_TYPE(obj);
23915  if (likely(tp->tp_getattro))
23916  return tp->tp_getattro(obj, attr_name);
23917 #if PY_MAJOR_VERSION < 3
23918  if (likely(tp->tp_getattr))
23919  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23920 #endif
23921  return PyObject_GetAttr(obj, attr_name);
23922 }
23923 #endif
23924 
23925 /* GetBuiltinName */
23926 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23927  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23928  if (unlikely(!result)) {
23929  PyErr_Format(PyExc_NameError,
23930 #if PY_MAJOR_VERSION >= 3
23931  "name '%U' is not defined", name);
23932 #else
23933  "name '%.200s' is not defined", PyString_AS_STRING(name));
23934 #endif
23935  }
23936  return result;
23937 }
23938 
23939 /* RaiseDoubleKeywords */
23940 static void __Pyx_RaiseDoubleKeywordsError(
23941  const char* func_name,
23942  PyObject* kw_name)
23943 {
23944  PyErr_Format(PyExc_TypeError,
23945  #if PY_MAJOR_VERSION >= 3
23946  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23947  #else
23948  "%s() got multiple values for keyword argument '%s'", func_name,
23949  PyString_AsString(kw_name));
23950  #endif
23951 }
23952 
23953 /* ParseKeywords */
23954 static int __Pyx_ParseOptionalKeywords(
23955  PyObject *kwds,
23956  PyObject **argnames[],
23957  PyObject *kwds2,
23958  PyObject *values[],
23959  Py_ssize_t num_pos_args,
23960  const char* function_name)
23961 {
23962  PyObject *key = 0, *value = 0;
23963  Py_ssize_t pos = 0;
23964  PyObject*** name;
23965  PyObject*** first_kw_arg = argnames + num_pos_args;
23966  while (PyDict_Next(kwds, &pos, &key, &value)) {
23967  name = first_kw_arg;
23968  while (*name && (**name != key)) name++;
23969  if (*name) {
23970  values[name-argnames] = value;
23971  continue;
23972  }
23973  name = first_kw_arg;
23974  #if PY_MAJOR_VERSION < 3
23975  if (likely(PyString_Check(key))) {
23976  while (*name) {
23977  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23978  && _PyString_Eq(**name, key)) {
23979  values[name-argnames] = value;
23980  break;
23981  }
23982  name++;
23983  }
23984  if (*name) continue;
23985  else {
23986  PyObject*** argname = argnames;
23987  while (argname != first_kw_arg) {
23988  if ((**argname == key) || (
23989  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23990  && _PyString_Eq(**argname, key))) {
23991  goto arg_passed_twice;
23992  }
23993  argname++;
23994  }
23995  }
23996  } else
23997  #endif
23998  if (likely(PyUnicode_Check(key))) {
23999  while (*name) {
24000  int cmp = (**name == key) ? 0 :
24001  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24002  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24003  #endif
24004  PyUnicode_Compare(**name, key);
24005  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24006  if (cmp == 0) {
24007  values[name-argnames] = value;
24008  break;
24009  }
24010  name++;
24011  }
24012  if (*name) continue;
24013  else {
24014  PyObject*** argname = argnames;
24015  while (argname != first_kw_arg) {
24016  int cmp = (**argname == key) ? 0 :
24017  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24018  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24019  #endif
24020  PyUnicode_Compare(**argname, key);
24021  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24022  if (cmp == 0) goto arg_passed_twice;
24023  argname++;
24024  }
24025  }
24026  } else
24027  goto invalid_keyword_type;
24028  if (kwds2) {
24029  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24030  } else {
24031  goto invalid_keyword;
24032  }
24033  }
24034  return 0;
24035 arg_passed_twice:
24036  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24037  goto bad;
24038 invalid_keyword_type:
24039  PyErr_Format(PyExc_TypeError,
24040  "%.200s() keywords must be strings", function_name);
24041  goto bad;
24042 invalid_keyword:
24043  PyErr_Format(PyExc_TypeError,
24044  #if PY_MAJOR_VERSION < 3
24045  "%.200s() got an unexpected keyword argument '%.200s'",
24046  function_name, PyString_AsString(key));
24047  #else
24048  "%s() got an unexpected keyword argument '%U'",
24049  function_name, key);
24050  #endif
24051 bad:
24052  return -1;
24053 }
24054 
24055 /* RaiseArgTupleInvalid */
24056 static void __Pyx_RaiseArgtupleInvalid(
24057  const char* func_name,
24058  int exact,
24059  Py_ssize_t num_min,
24060  Py_ssize_t num_max,
24061  Py_ssize_t num_found)
24062 {
24063  Py_ssize_t num_expected;
24064  const char *more_or_less;
24065  if (num_found < num_min) {
24066  num_expected = num_min;
24067  more_or_less = "at least";
24068  } else {
24069  num_expected = num_max;
24070  more_or_less = "at most";
24071  }
24072  if (exact) {
24073  more_or_less = "exactly";
24074  }
24075  PyErr_Format(PyExc_TypeError,
24076  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24077  func_name, more_or_less, num_expected,
24078  (num_expected == 1) ? "" : "s", num_found);
24079 }
24080 
24081 /* PyErrFetchRestore */
24082 #if CYTHON_FAST_THREAD_STATE
24083 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24084  PyObject *tmp_type, *tmp_value, *tmp_tb;
24085  tmp_type = tstate->curexc_type;
24086  tmp_value = tstate->curexc_value;
24087  tmp_tb = tstate->curexc_traceback;
24088  tstate->curexc_type = type;
24089  tstate->curexc_value = value;
24090  tstate->curexc_traceback = tb;
24091  Py_XDECREF(tmp_type);
24092  Py_XDECREF(tmp_value);
24093  Py_XDECREF(tmp_tb);
24094 }
24095 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24096  *type = tstate->curexc_type;
24097  *value = tstate->curexc_value;
24098  *tb = tstate->curexc_traceback;
24099  tstate->curexc_type = 0;
24100  tstate->curexc_value = 0;
24101  tstate->curexc_traceback = 0;
24102 }
24103 #endif
24104 
24105 /* Profile */
24106 #if CYTHON_PROFILE
24107 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24108  PyFrameObject** frame,
24109  PyThreadState* tstate,
24110  const char *funcname,
24111  const char *srcfile,
24112  int firstlineno) {
24113  PyObject *type, *value, *traceback;
24114  int retval;
24115  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24116  if (*code == NULL) {
24117  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24118  if (*code == NULL) return 0;
24119  }
24120  *frame = PyFrame_New(
24121  tstate, /*PyThreadState *tstate*/
24122  *code, /*PyCodeObject *code*/
24123  __pyx_d, /*PyObject *globals*/
24124  0 /*PyObject *locals*/
24125  );
24126  if (*frame == NULL) return 0;
24127  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24128  Py_INCREF(Py_None);
24129  (*frame)->f_trace = Py_None;
24130  }
24131 #if PY_VERSION_HEX < 0x030400B1
24132  } else {
24133  (*frame)->f_tstate = tstate;
24134 #endif
24135  }
24136  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24137  retval = 1;
24138  __Pyx_EnterTracing(tstate);
24139  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24140  #if CYTHON_TRACE
24141  if (tstate->c_tracefunc)
24142  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24143  if (retval && tstate->c_profilefunc)
24144  #endif
24145  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24146  __Pyx_LeaveTracing(tstate);
24147  if (retval) {
24148  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24149  return __Pyx_IsTracing(tstate, 0, 0) && retval;
24150  } else {
24151  Py_XDECREF(type);
24152  Py_XDECREF(value);
24153  Py_XDECREF(traceback);
24154  return -1;
24155  }
24156 }
24157 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
24158  PyCodeObject *py_code = 0;
24159 #if PY_MAJOR_VERSION >= 3
24160  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24161  if (likely(py_code)) {
24162  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24163  }
24164 #else
24165  PyObject *py_srcfile = 0;
24166  PyObject *py_funcname = 0;
24167  py_funcname = PyString_FromString(funcname);
24168  if (unlikely(!py_funcname)) goto bad;
24169  py_srcfile = PyString_FromString(srcfile);
24170  if (unlikely(!py_srcfile)) goto bad;
24171  py_code = PyCode_New(
24172  0,
24173  0,
24174  0,
24175  CO_OPTIMIZED | CO_NEWLOCALS,
24176  __pyx_empty_bytes, /*PyObject *code,*/
24177  __pyx_empty_tuple, /*PyObject *consts,*/
24178  __pyx_empty_tuple, /*PyObject *names,*/
24179  __pyx_empty_tuple, /*PyObject *varnames,*/
24180  __pyx_empty_tuple, /*PyObject *freevars,*/
24181  __pyx_empty_tuple, /*PyObject *cellvars,*/
24182  py_srcfile, /*PyObject *filename,*/
24183  py_funcname, /*PyObject *name,*/
24184  firstlineno,
24185  __pyx_empty_bytes /*PyObject *lnotab*/
24186  );
24187 bad:
24188  Py_XDECREF(py_srcfile);
24189  Py_XDECREF(py_funcname);
24190 #endif
24191  return py_code;
24192 }
24193 #endif
24194 
24195 /* PyObjectCall */
24196 #if CYTHON_COMPILING_IN_CPYTHON
24197 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24198  PyObject *result;
24199  ternaryfunc call = Py_TYPE(func)->tp_call;
24200  if (unlikely(!call))
24201  return PyObject_Call(func, arg, kw);
24202  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24203  return NULL;
24204  result = (*call)(func, arg, kw);
24205  Py_LeaveRecursiveCall();
24206  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24207  PyErr_SetString(
24208  PyExc_SystemError,
24209  "NULL result without error in PyObject_Call");
24210  }
24211  return result;
24212 }
24213 #endif
24214 
24215 /* RaiseException */
24216 #if PY_MAJOR_VERSION < 3
24217 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24218  CYTHON_UNUSED PyObject *cause) {
24219  __Pyx_PyThreadState_declare
24220  Py_XINCREF(type);
24221  if (!value || value == Py_None)
24222  value = NULL;
24223  else
24224  Py_INCREF(value);
24225  if (!tb || tb == Py_None)
24226  tb = NULL;
24227  else {
24228  Py_INCREF(tb);
24229  if (!PyTraceBack_Check(tb)) {
24230  PyErr_SetString(PyExc_TypeError,
24231  "raise: arg 3 must be a traceback or None");
24232  goto raise_error;
24233  }
24234  }
24235  if (PyType_Check(type)) {
24236 #if CYTHON_COMPILING_IN_PYPY
24237  if (!value) {
24238  Py_INCREF(Py_None);
24239  value = Py_None;
24240  }
24241 #endif
24242  PyErr_NormalizeException(&type, &value, &tb);
24243  } else {
24244  if (value) {
24245  PyErr_SetString(PyExc_TypeError,
24246  "instance exception may not have a separate value");
24247  goto raise_error;
24248  }
24249  value = type;
24250  type = (PyObject*) Py_TYPE(type);
24251  Py_INCREF(type);
24252  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24253  PyErr_SetString(PyExc_TypeError,
24254  "raise: exception class must be a subclass of BaseException");
24255  goto raise_error;
24256  }
24257  }
24258  __Pyx_PyThreadState_assign
24259  __Pyx_ErrRestore(type, value, tb);
24260  return;
24261 raise_error:
24262  Py_XDECREF(value);
24263  Py_XDECREF(type);
24264  Py_XDECREF(tb);
24265  return;
24266 }
24267 #else
24268 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24269  PyObject* owned_instance = NULL;
24270  if (tb == Py_None) {
24271  tb = 0;
24272  } else if (tb && !PyTraceBack_Check(tb)) {
24273  PyErr_SetString(PyExc_TypeError,
24274  "raise: arg 3 must be a traceback or None");
24275  goto bad;
24276  }
24277  if (value == Py_None)
24278  value = 0;
24279  if (PyExceptionInstance_Check(type)) {
24280  if (value) {
24281  PyErr_SetString(PyExc_TypeError,
24282  "instance exception may not have a separate value");
24283  goto bad;
24284  }
24285  value = type;
24286  type = (PyObject*) Py_TYPE(value);
24287  } else if (PyExceptionClass_Check(type)) {
24288  PyObject *instance_class = NULL;
24289  if (value && PyExceptionInstance_Check(value)) {
24290  instance_class = (PyObject*) Py_TYPE(value);
24291  if (instance_class != type) {
24292  int is_subclass = PyObject_IsSubclass(instance_class, type);
24293  if (!is_subclass) {
24294  instance_class = NULL;
24295  } else if (unlikely(is_subclass == -1)) {
24296  goto bad;
24297  } else {
24298  type = instance_class;
24299  }
24300  }
24301  }
24302  if (!instance_class) {
24303  PyObject *args;
24304  if (!value)
24305  args = PyTuple_New(0);
24306  else if (PyTuple_Check(value)) {
24307  Py_INCREF(value);
24308  args = value;
24309  } else
24310  args = PyTuple_Pack(1, value);
24311  if (!args)
24312  goto bad;
24313  owned_instance = PyObject_Call(type, args, NULL);
24314  Py_DECREF(args);
24315  if (!owned_instance)
24316  goto bad;
24317  value = owned_instance;
24318  if (!PyExceptionInstance_Check(value)) {
24319  PyErr_Format(PyExc_TypeError,
24320  "calling %R should have returned an instance of "
24321  "BaseException, not %R",
24322  type, Py_TYPE(value));
24323  goto bad;
24324  }
24325  }
24326  } else {
24327  PyErr_SetString(PyExc_TypeError,
24328  "raise: exception class must be a subclass of BaseException");
24329  goto bad;
24330  }
24331  if (cause) {
24332  PyObject *fixed_cause;
24333  if (cause == Py_None) {
24334  fixed_cause = NULL;
24335  } else if (PyExceptionClass_Check(cause)) {
24336  fixed_cause = PyObject_CallObject(cause, NULL);
24337  if (fixed_cause == NULL)
24338  goto bad;
24339  } else if (PyExceptionInstance_Check(cause)) {
24340  fixed_cause = cause;
24341  Py_INCREF(fixed_cause);
24342  } else {
24343  PyErr_SetString(PyExc_TypeError,
24344  "exception causes must derive from "
24345  "BaseException");
24346  goto bad;
24347  }
24348  PyException_SetCause(value, fixed_cause);
24349  }
24350  PyErr_SetObject(type, value);
24351  if (tb) {
24352 #if CYTHON_FAST_THREAD_STATE
24353  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24354  PyObject* tmp_tb = tstate->curexc_traceback;
24355  if (tb != tmp_tb) {
24356  Py_INCREF(tb);
24357  tstate->curexc_traceback = tb;
24358  Py_XDECREF(tmp_tb);
24359  }
24360 #else
24361  PyObject *tmp_type, *tmp_value, *tmp_tb;
24362  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24363  Py_INCREF(tb);
24364  PyErr_Restore(tmp_type, tmp_value, tb);
24365  Py_XDECREF(tmp_tb);
24366 #endif
24367  }
24368 bad:
24369  Py_XDECREF(owned_instance);
24370  return;
24371 }
24372 #endif
24373 
24374 /* PyIntCompare */
24375 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
24376  if (op1 == op2) {
24377  Py_RETURN_FALSE;
24378  }
24379  #if PY_MAJOR_VERSION < 3
24380  if (likely(PyInt_CheckExact(op1))) {
24381  const long b = intval;
24382  long a = PyInt_AS_LONG(op1);
24383  if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24384  }
24385  #endif
24386  #if CYTHON_USE_PYLONG_INTERNALS
24387  if (likely(PyLong_CheckExact(op1))) {
24388  int unequal;
24389  unsigned long uintval;
24390  Py_ssize_t size = Py_SIZE(op1);
24391  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24392  if (intval == 0) {
24393  if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24394  } else if (intval < 0) {
24395  if (size >= 0)
24396  Py_RETURN_TRUE;
24397  intval = -intval;
24398  size = -size;
24399  } else {
24400  if (size <= 0)
24401  Py_RETURN_TRUE;
24402  }
24403  uintval = (unsigned long) intval;
24404 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24405  if (uintval >> (PyLong_SHIFT * 4)) {
24406  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24407  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24408  } else
24409 #endif
24410 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24411  if (uintval >> (PyLong_SHIFT * 3)) {
24412  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24413  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24414  } else
24415 #endif
24416 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24417  if (uintval >> (PyLong_SHIFT * 2)) {
24418  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24419  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24420  } else
24421 #endif
24422 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24423  if (uintval >> (PyLong_SHIFT * 1)) {
24424  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24425  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24426  } else
24427 #endif
24428  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
24429  if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24430  }
24431  #endif
24432  if (PyFloat_CheckExact(op1)) {
24433  const long b = intval;
24434  double a = PyFloat_AS_DOUBLE(op1);
24435  if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24436  }
24437  return (
24438  PyObject_RichCompare(op1, op2, Py_NE));
24439 }
24440 
24441 /* BytesEquals */
24442 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24443 #if CYTHON_COMPILING_IN_PYPY
24444  return PyObject_RichCompareBool(s1, s2, equals);
24445 #else
24446  if (s1 == s2) {
24447  return (equals == Py_EQ);
24448  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24449  const char *ps1, *ps2;
24450  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24451  if (length != PyBytes_GET_SIZE(s2))
24452  return (equals == Py_NE);
24453  ps1 = PyBytes_AS_STRING(s1);
24454  ps2 = PyBytes_AS_STRING(s2);
24455  if (ps1[0] != ps2[0]) {
24456  return (equals == Py_NE);
24457  } else if (length == 1) {
24458  return (equals == Py_EQ);
24459  } else {
24460  int result;
24461 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24462  Py_hash_t hash1, hash2;
24463  hash1 = ((PyBytesObject*)s1)->ob_shash;
24464  hash2 = ((PyBytesObject*)s2)->ob_shash;
24465  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24466  return (equals == Py_NE);
24467  }
24468 #endif
24469  result = memcmp(ps1, ps2, (size_t)length);
24470  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24471  }
24472  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24473  return (equals == Py_NE);
24474  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24475  return (equals == Py_NE);
24476  } else {
24477  int result;
24478  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24479  if (!py_result)
24480  return -1;
24481  result = __Pyx_PyObject_IsTrue(py_result);
24482  Py_DECREF(py_result);
24483  return result;
24484  }
24485 #endif
24486 }
24487 
24488 /* PyDictVersioning */
24489 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24490 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24491  PyObject *dict = Py_TYPE(obj)->tp_dict;
24492  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24493 }
24494 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24495  PyObject **dictptr = NULL;
24496  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24497  if (offset) {
24498 #if CYTHON_COMPILING_IN_CPYTHON
24499  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24500 #else
24501  dictptr = _PyObject_GetDictPtr(obj);
24502 #endif
24503  }
24504  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24505 }
24506 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24507  PyObject *dict = Py_TYPE(obj)->tp_dict;
24508  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24509  return 0;
24510  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24511 }
24512 #endif
24513 
24514 /* GetModuleGlobalName */
24515 #if CYTHON_USE_DICT_VERSIONS
24516 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24517 #else
24518 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24519 #endif
24520 {
24521  PyObject *result;
24522 #if !CYTHON_AVOID_BORROWED_REFS
24523 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24524  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24525  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24526  if (likely(result)) {
24527  return __Pyx_NewRef(result);
24528  } else if (unlikely(PyErr_Occurred())) {
24529  return NULL;
24530  }
24531 #else
24532  result = PyDict_GetItem(__pyx_d, name);
24533  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24534  if (likely(result)) {
24535  return __Pyx_NewRef(result);
24536  }
24537 #endif
24538 #else
24539  result = PyObject_GetItem(__pyx_d, name);
24540  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24541  if (likely(result)) {
24542  return __Pyx_NewRef(result);
24543  }
24544  PyErr_Clear();
24545 #endif
24546  return __Pyx_GetBuiltinName(name);
24547 }
24548 
24549 /* PyCFunctionFastCall */
24550 #if CYTHON_FAST_PYCCALL
24551 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24552  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24553  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24554  PyObject *self = PyCFunction_GET_SELF(func);
24555  int flags = PyCFunction_GET_FLAGS(func);
24556  assert(PyCFunction_Check(func));
24557  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24558  assert(nargs >= 0);
24559  assert(nargs == 0 || args != NULL);
24560  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24561  because it may clear it (directly or indirectly) and so the
24562  caller loses its exception */
24563  assert(!PyErr_Occurred());
24564  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24565  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24566  } else {
24567  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24568  }
24569 }
24570 #endif
24571 
24572 /* PyFunctionFastCall */
24573 #if CYTHON_FAST_PYCALL
24574 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24575  PyObject *globals) {
24576  PyFrameObject *f;
24577  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24578  PyObject **fastlocals;
24579  Py_ssize_t i;
24580  PyObject *result;
24581  assert(globals != NULL);
24582  /* XXX Perhaps we should create a specialized
24583  PyFrame_New() that doesn't take locals, but does
24584  take builtins without sanity checking them.
24585  */
24586  assert(tstate != NULL);
24587  f = PyFrame_New(tstate, co, globals, NULL);
24588  if (f == NULL) {
24589  return NULL;
24590  }
24591  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24592  for (i = 0; i < na; i++) {
24593  Py_INCREF(*args);
24594  fastlocals[i] = *args++;
24595  }
24596  result = PyEval_EvalFrameEx(f,0);
24597  ++tstate->recursion_depth;
24598  Py_DECREF(f);
24599  --tstate->recursion_depth;
24600  return result;
24601 }
24602 #if 1 || PY_VERSION_HEX < 0x030600B1
24603 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24604  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24605  PyObject *globals = PyFunction_GET_GLOBALS(func);
24606  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24607  PyObject *closure;
24608 #if PY_MAJOR_VERSION >= 3
24609  PyObject *kwdefs;
24610 #endif
24611  PyObject *kwtuple, **k;
24612  PyObject **d;
24613  Py_ssize_t nd;
24614  Py_ssize_t nk;
24615  PyObject *result;
24616  assert(kwargs == NULL || PyDict_Check(kwargs));
24617  nk = kwargs ? PyDict_Size(kwargs) : 0;
24618  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24619  return NULL;
24620  }
24621  if (
24622 #if PY_MAJOR_VERSION >= 3
24623  co->co_kwonlyargcount == 0 &&
24624 #endif
24625  likely(kwargs == NULL || nk == 0) &&
24626  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24627  if (argdefs == NULL && co->co_argcount == nargs) {
24628  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24629  goto done;
24630  }
24631  else if (nargs == 0 && argdefs != NULL
24632  && co->co_argcount == Py_SIZE(argdefs)) {
24633  /* function called with no arguments, but all parameters have
24634  a default value: use default values as arguments .*/
24635  args = &PyTuple_GET_ITEM(argdefs, 0);
24636  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24637  goto done;
24638  }
24639  }
24640  if (kwargs != NULL) {
24641  Py_ssize_t pos, i;
24642  kwtuple = PyTuple_New(2 * nk);
24643  if (kwtuple == NULL) {
24644  result = NULL;
24645  goto done;
24646  }
24647  k = &PyTuple_GET_ITEM(kwtuple, 0);
24648  pos = i = 0;
24649  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24650  Py_INCREF(k[i]);
24651  Py_INCREF(k[i+1]);
24652  i += 2;
24653  }
24654  nk = i / 2;
24655  }
24656  else {
24657  kwtuple = NULL;
24658  k = NULL;
24659  }
24660  closure = PyFunction_GET_CLOSURE(func);
24661 #if PY_MAJOR_VERSION >= 3
24662  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24663 #endif
24664  if (argdefs != NULL) {
24665  d = &PyTuple_GET_ITEM(argdefs, 0);
24666  nd = Py_SIZE(argdefs);
24667  }
24668  else {
24669  d = NULL;
24670  nd = 0;
24671  }
24672 #if PY_MAJOR_VERSION >= 3
24673  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24674  args, (int)nargs,
24675  k, (int)nk,
24676  d, (int)nd, kwdefs, closure);
24677 #else
24678  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24679  args, (int)nargs,
24680  k, (int)nk,
24681  d, (int)nd, closure);
24682 #endif
24683  Py_XDECREF(kwtuple);
24684 done:
24685  Py_LeaveRecursiveCall();
24686  return result;
24687 }
24688 #endif
24689 #endif
24690 
24691 /* PyObjectCall2Args */
24692 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24693  PyObject *args, *result = NULL;
24694  #if CYTHON_FAST_PYCALL
24695  if (PyFunction_Check(function)) {
24696  PyObject *args[2] = {arg1, arg2};
24697  return __Pyx_PyFunction_FastCall(function, args, 2);
24698  }
24699  #endif
24700  #if CYTHON_FAST_PYCCALL
24701  if (__Pyx_PyFastCFunction_Check(function)) {
24702  PyObject *args[2] = {arg1, arg2};
24703  return __Pyx_PyCFunction_FastCall(function, args, 2);
24704  }
24705  #endif
24706  args = PyTuple_New(2);
24707  if (unlikely(!args)) goto done;
24708  Py_INCREF(arg1);
24709  PyTuple_SET_ITEM(args, 0, arg1);
24710  Py_INCREF(arg2);
24711  PyTuple_SET_ITEM(args, 1, arg2);
24712  Py_INCREF(function);
24713  result = __Pyx_PyObject_Call(function, args, NULL);
24714  Py_DECREF(args);
24715  Py_DECREF(function);
24716 done:
24717  return result;
24718 }
24719 
24720 /* PyObjectCallMethO */
24721 #if CYTHON_COMPILING_IN_CPYTHON
24722 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24723  PyObject *self, *result;
24724  PyCFunction cfunc;
24725  cfunc = PyCFunction_GET_FUNCTION(func);
24726  self = PyCFunction_GET_SELF(func);
24727  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24728  return NULL;
24729  result = cfunc(self, arg);
24730  Py_LeaveRecursiveCall();
24731  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24732  PyErr_SetString(
24733  PyExc_SystemError,
24734  "NULL result without error in PyObject_Call");
24735  }
24736  return result;
24737 }
24738 #endif
24739 
24740 /* PyObjectCallOneArg */
24741 #if CYTHON_COMPILING_IN_CPYTHON
24742 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24743  PyObject *result;
24744  PyObject *args = PyTuple_New(1);
24745  if (unlikely(!args)) return NULL;
24746  Py_INCREF(arg);
24747  PyTuple_SET_ITEM(args, 0, arg);
24748  result = __Pyx_PyObject_Call(func, args, NULL);
24749  Py_DECREF(args);
24750  return result;
24751 }
24752 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24753 #if CYTHON_FAST_PYCALL
24754  if (PyFunction_Check(func)) {
24755  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24756  }
24757 #endif
24758  if (likely(PyCFunction_Check(func))) {
24759  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24760  return __Pyx_PyObject_CallMethO(func, arg);
24761 #if CYTHON_FAST_PYCCALL
24762  } else if (__Pyx_PyFastCFunction_Check(func)) {
24763  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24764 #endif
24765  }
24766  }
24767  return __Pyx__PyObject_CallOneArg(func, arg);
24768 }
24769 #else
24770 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24771  PyObject *result;
24772  PyObject *args = PyTuple_Pack(1, arg);
24773  if (unlikely(!args)) return NULL;
24774  result = __Pyx_PyObject_Call(func, args, NULL);
24775  Py_DECREF(args);
24776  return result;
24777 }
24778 #endif
24779 
24780 /* PyObjectCallNoArg */
24781 #if CYTHON_COMPILING_IN_CPYTHON
24782 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24783 #if CYTHON_FAST_PYCALL
24784  if (PyFunction_Check(func)) {
24785  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24786  }
24787 #endif
24788 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
24789  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24790 #else
24791  if (likely(PyCFunction_Check(func)))
24792 #endif
24793  {
24794  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24795  return __Pyx_PyObject_CallMethO(func, NULL);
24796  }
24797  }
24798  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24799 }
24800 #endif
24801 
24802 /* GetItemInt */
24803 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24804  PyObject *r;
24805  if (!j) return NULL;
24806  r = PyObject_GetItem(o, j);
24807  Py_DECREF(j);
24808  return r;
24809 }
24810 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24811  CYTHON_NCP_UNUSED int wraparound,
24812  CYTHON_NCP_UNUSED int boundscheck) {
24813 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24814  Py_ssize_t wrapped_i = i;
24815  if (wraparound & unlikely(i < 0)) {
24816  wrapped_i += PyList_GET_SIZE(o);
24817  }
24818  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24819  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24820  Py_INCREF(r);
24821  return r;
24822  }
24823  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24824 #else
24825  return PySequence_GetItem(o, i);
24826 #endif
24827 }
24828 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24829  CYTHON_NCP_UNUSED int wraparound,
24830  CYTHON_NCP_UNUSED int boundscheck) {
24831 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24832  Py_ssize_t wrapped_i = i;
24833  if (wraparound & unlikely(i < 0)) {
24834  wrapped_i += PyTuple_GET_SIZE(o);
24835  }
24836  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24837  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24838  Py_INCREF(r);
24839  return r;
24840  }
24841  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24842 #else
24843  return PySequence_GetItem(o, i);
24844 #endif
24845 }
24846 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24847  CYTHON_NCP_UNUSED int wraparound,
24848  CYTHON_NCP_UNUSED int boundscheck) {
24849 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24850  if (is_list || PyList_CheckExact(o)) {
24851  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24852  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24853  PyObject *r = PyList_GET_ITEM(o, n);
24854  Py_INCREF(r);
24855  return r;
24856  }
24857  }
24858  else if (PyTuple_CheckExact(o)) {
24859  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24860  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24861  PyObject *r = PyTuple_GET_ITEM(o, n);
24862  Py_INCREF(r);
24863  return r;
24864  }
24865  } else {
24866  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24867  if (likely(m && m->sq_item)) {
24868  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24869  Py_ssize_t l = m->sq_length(o);
24870  if (likely(l >= 0)) {
24871  i += l;
24872  } else {
24873  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24874  return NULL;
24875  PyErr_Clear();
24876  }
24877  }
24878  return m->sq_item(o, i);
24879  }
24880  }
24881 #else
24882  if (is_list || PySequence_Check(o)) {
24883  return PySequence_GetItem(o, i);
24884  }
24885 #endif
24886  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24887 }
24888 
24889 /* DictGetItem */
24890 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24891 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24892  PyObject *value;
24893  value = PyDict_GetItemWithError(d, key);
24894  if (unlikely(!value)) {
24895  if (!PyErr_Occurred()) {
24896  if (unlikely(PyTuple_Check(key))) {
24897  PyObject* args = PyTuple_Pack(1, key);
24898  if (likely(args)) {
24899  PyErr_SetObject(PyExc_KeyError, args);
24900  Py_DECREF(args);
24901  }
24902  } else {
24903  PyErr_SetObject(PyExc_KeyError, key);
24904  }
24905  }
24906  return NULL;
24907  }
24908  Py_INCREF(value);
24909  return value;
24910 }
24911 #endif
24912 
24913 /* MemviewSliceInit */
24914 static int
24915 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24916  int ndim,
24917  __Pyx_memviewslice *memviewslice,
24918  int memview_is_new_reference)
24919 {
24920  __Pyx_RefNannyDeclarations
24921  int i, retval=-1;
24922  Py_buffer *buf = &memview->view;
24923  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24924  if (unlikely(memviewslice->memview || memviewslice->data)) {
24925  PyErr_SetString(PyExc_ValueError,
24926  "memviewslice is already initialized!");
24927  goto fail;
24928  }
24929  if (buf->strides) {
24930  for (i = 0; i < ndim; i++) {
24931  memviewslice->strides[i] = buf->strides[i];
24932  }
24933  } else {
24934  Py_ssize_t stride = buf->itemsize;
24935  for (i = ndim - 1; i >= 0; i--) {
24936  memviewslice->strides[i] = stride;
24937  stride *= buf->shape[i];
24938  }
24939  }
24940  for (i = 0; i < ndim; i++) {
24941  memviewslice->shape[i] = buf->shape[i];
24942  if (buf->suboffsets) {
24943  memviewslice->suboffsets[i] = buf->suboffsets[i];
24944  } else {
24945  memviewslice->suboffsets[i] = -1;
24946  }
24947  }
24948  memviewslice->memview = memview;
24949  memviewslice->data = (char *)buf->buf;
24950  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24951  Py_INCREF(memview);
24952  }
24953  retval = 0;
24954  goto no_fail;
24955 fail:
24956  memviewslice->memview = 0;
24957  memviewslice->data = 0;
24958  retval = -1;
24959 no_fail:
24960  __Pyx_RefNannyFinishContext();
24961  return retval;
24962 }
24963 #ifndef Py_NO_RETURN
24964 #define Py_NO_RETURN
24965 #endif
24966 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24967  va_list vargs;
24968  char msg[200];
24969 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
24970  va_start(vargs, fmt);
24971 #else
24972  va_start(vargs);
24973 #endif
24974  vsnprintf(msg, 200, fmt, vargs);
24975  va_end(vargs);
24976  Py_FatalError(msg);
24977 }
24978 static CYTHON_INLINE int
24979 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24980  PyThread_type_lock lock)
24981 {
24982  int result;
24983  PyThread_acquire_lock(lock, 1);
24984  result = (*acquisition_count)++;
24985  PyThread_release_lock(lock);
24986  return result;
24987 }
24988 static CYTHON_INLINE int
24989 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24990  PyThread_type_lock lock)
24991 {
24992  int result;
24993  PyThread_acquire_lock(lock, 1);
24994  result = (*acquisition_count)--;
24995  PyThread_release_lock(lock);
24996  return result;
24997 }
24998 static CYTHON_INLINE void
24999 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
25000 {
25001  int first_time;
25002  struct __pyx_memoryview_obj *memview = memslice->memview;
25003  if (unlikely(!memview || (PyObject *) memview == Py_None))
25004  return;
25005  if (unlikely(__pyx_get_slice_count(memview) < 0))
25006  __pyx_fatalerror("Acquisition count is %d (line %d)",
25007  __pyx_get_slice_count(memview), lineno);
25008  first_time = __pyx_add_acquisition_count(memview) == 0;
25009  if (unlikely(first_time)) {
25010  if (have_gil) {
25011  Py_INCREF((PyObject *) memview);
25012  } else {
25013  PyGILState_STATE _gilstate = PyGILState_Ensure();
25014  Py_INCREF((PyObject *) memview);
25015  PyGILState_Release(_gilstate);
25016  }
25017  }
25018 }
25019 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25020  int have_gil, int lineno) {
25021  int last_time;
25022  struct __pyx_memoryview_obj *memview = memslice->memview;
25023  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
25024  memslice->memview = NULL;
25025  return;
25026  }
25027  if (unlikely(__pyx_get_slice_count(memview) <= 0))
25028  __pyx_fatalerror("Acquisition count is %d (line %d)",
25029  __pyx_get_slice_count(memview), lineno);
25030  last_time = __pyx_sub_acquisition_count(memview) == 1;
25031  memslice->data = NULL;
25032  if (unlikely(last_time)) {
25033  if (have_gil) {
25034  Py_CLEAR(memslice->memview);
25035  } else {
25036  PyGILState_STATE _gilstate = PyGILState_Ensure();
25037  Py_CLEAR(memslice->memview);
25038  PyGILState_Release(_gilstate);
25039  }
25040  } else {
25041  memslice->memview = NULL;
25042  }
25043 }
25044 
25045 /* ArgTypeTest */
25046 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
25047 {
25048  if (unlikely(!type)) {
25049  PyErr_SetString(PyExc_SystemError, "Missing type object");
25050  return 0;
25051  }
25052  else if (exact) {
25053  #if PY_MAJOR_VERSION == 2
25054  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
25055  #endif
25056  }
25057  else {
25058  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
25059  }
25060  PyErr_Format(PyExc_TypeError,
25061  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25062  name, type->tp_name, Py_TYPE(obj)->tp_name);
25063  return 0;
25064 }
25065 
25066 /* UnicodeEquals */
25067 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25068 #if CYTHON_COMPILING_IN_PYPY
25069  return PyObject_RichCompareBool(s1, s2, equals);
25070 #else
25071 #if PY_MAJOR_VERSION < 3
25072  PyObject* owned_ref = NULL;
25073 #endif
25074  int s1_is_unicode, s2_is_unicode;
25075  if (s1 == s2) {
25076  goto return_eq;
25077  }
25078  s1_is_unicode = PyUnicode_CheckExact(s1);
25079  s2_is_unicode = PyUnicode_CheckExact(s2);
25080 #if PY_MAJOR_VERSION < 3
25081  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25082  owned_ref = PyUnicode_FromObject(s2);
25083  if (unlikely(!owned_ref))
25084  return -1;
25085  s2 = owned_ref;
25086  s2_is_unicode = 1;
25087  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25088  owned_ref = PyUnicode_FromObject(s1);
25089  if (unlikely(!owned_ref))
25090  return -1;
25091  s1 = owned_ref;
25092  s1_is_unicode = 1;
25093  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25094  return __Pyx_PyBytes_Equals(s1, s2, equals);
25095  }
25096 #endif
25097  if (s1_is_unicode & s2_is_unicode) {
25098  Py_ssize_t length;
25099  int kind;
25100  void *data1, *data2;
25101  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25102  return -1;
25103  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25104  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25105  goto return_ne;
25106  }
25107 #if CYTHON_USE_UNICODE_INTERNALS
25108  {
25109  Py_hash_t hash1, hash2;
25110  #if CYTHON_PEP393_ENABLED
25111  hash1 = ((PyASCIIObject*)s1)->hash;
25112  hash2 = ((PyASCIIObject*)s2)->hash;
25113  #else
25114  hash1 = ((PyUnicodeObject*)s1)->hash;
25115  hash2 = ((PyUnicodeObject*)s2)->hash;
25116  #endif
25117  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25118  goto return_ne;
25119  }
25120  }
25121 #endif
25122  kind = __Pyx_PyUnicode_KIND(s1);
25123  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25124  goto return_ne;
25125  }
25126  data1 = __Pyx_PyUnicode_DATA(s1);
25127  data2 = __Pyx_PyUnicode_DATA(s2);
25128  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25129  goto return_ne;
25130  } else if (length == 1) {
25131  goto return_eq;
25132  } else {
25133  int result = memcmp(data1, data2, (size_t)(length * kind));
25134  #if PY_MAJOR_VERSION < 3
25135  Py_XDECREF(owned_ref);
25136  #endif
25137  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25138  }
25139  } else if ((s1 == Py_None) & s2_is_unicode) {
25140  goto return_ne;
25141  } else if ((s2 == Py_None) & s1_is_unicode) {
25142  goto return_ne;
25143  } else {
25144  int result;
25145  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25146  #if PY_MAJOR_VERSION < 3
25147  Py_XDECREF(owned_ref);
25148  #endif
25149  if (!py_result)
25150  return -1;
25151  result = __Pyx_PyObject_IsTrue(py_result);
25152  Py_DECREF(py_result);
25153  return result;
25154  }
25155 return_eq:
25156  #if PY_MAJOR_VERSION < 3
25157  Py_XDECREF(owned_ref);
25158  #endif
25159  return (equals == Py_EQ);
25160 return_ne:
25161  #if PY_MAJOR_VERSION < 3
25162  Py_XDECREF(owned_ref);
25163  #endif
25164  return (equals == Py_NE);
25165 #endif
25166 }
25167 
25168 /* WriteUnraisableException */
25169 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25170  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25171  int full_traceback, CYTHON_UNUSED int nogil) {
25172  PyObject *old_exc, *old_val, *old_tb;
25173  PyObject *ctx;
25174  __Pyx_PyThreadState_declare
25175 #ifdef WITH_THREAD
25176  PyGILState_STATE state;
25177  if (nogil)
25178  state = PyGILState_Ensure();
25179  else state = (PyGILState_STATE)0;
25180 #endif
25181  __Pyx_PyThreadState_assign
25182  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25183  if (full_traceback) {
25184  Py_XINCREF(old_exc);
25185  Py_XINCREF(old_val);
25186  Py_XINCREF(old_tb);
25187  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25188  PyErr_PrintEx(1);
25189  }
25190  #if PY_MAJOR_VERSION < 3
25191  ctx = PyString_FromString(name);
25192  #else
25193  ctx = PyUnicode_FromString(name);
25194  #endif
25195  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25196  if (!ctx) {
25197  PyErr_WriteUnraisable(Py_None);
25198  } else {
25199  PyErr_WriteUnraisable(ctx);
25200  Py_DECREF(ctx);
25201  }
25202 #ifdef WITH_THREAD
25203  if (nogil)
25204  PyGILState_Release(state);
25205 #endif
25206 }
25207 
25208 /* GetAttr */
25209 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25210 #if CYTHON_USE_TYPE_SLOTS
25211 #if PY_MAJOR_VERSION >= 3
25212  if (likely(PyUnicode_Check(n)))
25213 #else
25214  if (likely(PyString_Check(n)))
25215 #endif
25216  return __Pyx_PyObject_GetAttrStr(o, n);
25217 #endif
25218  return PyObject_GetAttr(o, n);
25219 }
25220 
25221 /* ObjectGetItem */
25222 #if CYTHON_USE_TYPE_SLOTS
25223 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25224  PyObject *runerr = NULL;
25225  Py_ssize_t key_value;
25226  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25227  if (unlikely(!(m && m->sq_item))) {
25228  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25229  return NULL;
25230  }
25231  key_value = __Pyx_PyIndex_AsSsize_t(index);
25232  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25233  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25234  }
25235  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25236  PyErr_Clear();
25237  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25238  }
25239  return NULL;
25240 }
25241 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25242  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25243  if (likely(m && m->mp_subscript)) {
25244  return m->mp_subscript(obj, key);
25245  }
25246  return __Pyx_PyObject_GetIndex(obj, key);
25247 }
25248 #endif
25249 
25250 /* decode_c_string */
25251 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25252  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25253  const char* encoding, const char* errors,
25254  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25255  Py_ssize_t length;
25256  if (unlikely((start < 0) | (stop < 0))) {
25257  size_t slen = strlen(cstring);
25258  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25259  PyErr_SetString(PyExc_OverflowError,
25260  "c-string too long to convert to Python");
25261  return NULL;
25262  }
25263  length = (Py_ssize_t) slen;
25264  if (start < 0) {
25265  start += length;
25266  if (start < 0)
25267  start = 0;
25268  }
25269  if (stop < 0)
25270  stop += length;
25271  }
25272  if (unlikely(stop <= start))
25273  return __Pyx_NewRef(__pyx_empty_unicode);
25274  length = stop - start;
25275  cstring += start;
25276  if (decode_func) {
25277  return decode_func(cstring, length, errors);
25278  } else {
25279  return PyUnicode_Decode(cstring, length, encoding, errors);
25280  }
25281 }
25282 
25283 /* PyErrExceptionMatches */
25284 #if CYTHON_FAST_THREAD_STATE
25285 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25286  Py_ssize_t i, n;
25287  n = PyTuple_GET_SIZE(tuple);
25288 #if PY_MAJOR_VERSION >= 3
25289  for (i=0; i<n; i++) {
25290  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25291  }
25292 #endif
25293  for (i=0; i<n; i++) {
25294  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25295  }
25296  return 0;
25297 }
25298 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25299  PyObject *exc_type = tstate->curexc_type;
25300  if (exc_type == err) return 1;
25301  if (unlikely(!exc_type)) return 0;
25302  if (unlikely(PyTuple_Check(err)))
25303  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25304  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25305 }
25306 #endif
25307 
25308 /* GetAttr3 */
25309 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25310  __Pyx_PyThreadState_declare
25311  __Pyx_PyThreadState_assign
25312  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25313  return NULL;
25314  __Pyx_PyErr_Clear();
25315  Py_INCREF(d);
25316  return d;
25317 }
25318 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25319  PyObject *r = __Pyx_GetAttr(o, n);
25320  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25321 }
25322 
25323 /* RaiseTooManyValuesToUnpack */
25324 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25325  PyErr_Format(PyExc_ValueError,
25326  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25327 }
25328 
25329 /* RaiseNeedMoreValuesToUnpack */
25330 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25331  PyErr_Format(PyExc_ValueError,
25332  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25333  index, (index == 1) ? "" : "s");
25334 }
25335 
25336 /* RaiseNoneIterError */
25337 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25338  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25339 }
25340 
25341 /* ExtTypeTest */
25342 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25343  if (unlikely(!type)) {
25344  PyErr_SetString(PyExc_SystemError, "Missing type object");
25345  return 0;
25346  }
25347  if (likely(__Pyx_TypeCheck(obj, type)))
25348  return 1;
25349  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25350  Py_TYPE(obj)->tp_name, type->tp_name);
25351  return 0;
25352 }
25353 
25354 /* GetTopmostException */
25355 #if CYTHON_USE_EXC_INFO_STACK
25356 static _PyErr_StackItem *
25357 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25358 {
25359  _PyErr_StackItem *exc_info = tstate->exc_info;
25360  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25361  exc_info->previous_item != NULL)
25362  {
25363  exc_info = exc_info->previous_item;
25364  }
25365  return exc_info;
25366 }
25367 #endif
25368 
25369 /* SaveResetException */
25370 #if CYTHON_FAST_THREAD_STATE
25371 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25372  #if CYTHON_USE_EXC_INFO_STACK
25373  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25374  *type = exc_info->exc_type;
25375  *value = exc_info->exc_value;
25376  *tb = exc_info->exc_traceback;
25377  #else
25378  *type = tstate->exc_type;
25379  *value = tstate->exc_value;
25380  *tb = tstate->exc_traceback;
25381  #endif
25382  Py_XINCREF(*type);
25383  Py_XINCREF(*value);
25384  Py_XINCREF(*tb);
25385 }
25386 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25387  PyObject *tmp_type, *tmp_value, *tmp_tb;
25388  #if CYTHON_USE_EXC_INFO_STACK
25389  _PyErr_StackItem *exc_info = tstate->exc_info;
25390  tmp_type = exc_info->exc_type;
25391  tmp_value = exc_info->exc_value;
25392  tmp_tb = exc_info->exc_traceback;
25393  exc_info->exc_type = type;
25394  exc_info->exc_value = value;
25395  exc_info->exc_traceback = tb;
25396  #else
25397  tmp_type = tstate->exc_type;
25398  tmp_value = tstate->exc_value;
25399  tmp_tb = tstate->exc_traceback;
25400  tstate->exc_type = type;
25401  tstate->exc_value = value;
25402  tstate->exc_traceback = tb;
25403  #endif
25404  Py_XDECREF(tmp_type);
25405  Py_XDECREF(tmp_value);
25406  Py_XDECREF(tmp_tb);
25407 }
25408 #endif
25409 
25410 /* GetException */
25411 #if CYTHON_FAST_THREAD_STATE
25412 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25413 #else
25414 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25415 #endif
25416 {
25417  PyObject *local_type, *local_value, *local_tb;
25418 #if CYTHON_FAST_THREAD_STATE
25419  PyObject *tmp_type, *tmp_value, *tmp_tb;
25420  local_type = tstate->curexc_type;
25421  local_value = tstate->curexc_value;
25422  local_tb = tstate->curexc_traceback;
25423  tstate->curexc_type = 0;
25424  tstate->curexc_value = 0;
25425  tstate->curexc_traceback = 0;
25426 #else
25427  PyErr_Fetch(&local_type, &local_value, &local_tb);
25428 #endif
25429  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25430 #if CYTHON_FAST_THREAD_STATE
25431  if (unlikely(tstate->curexc_type))
25432 #else
25433  if (unlikely(PyErr_Occurred()))
25434 #endif
25435  goto bad;
25436  #if PY_MAJOR_VERSION >= 3
25437  if (local_tb) {
25438  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25439  goto bad;
25440  }
25441  #endif
25442  Py_XINCREF(local_tb);
25443  Py_XINCREF(local_type);
25444  Py_XINCREF(local_value);
25445  *type = local_type;
25446  *value = local_value;
25447  *tb = local_tb;
25448 #if CYTHON_FAST_THREAD_STATE
25449  #if CYTHON_USE_EXC_INFO_STACK
25450  {
25451  _PyErr_StackItem *exc_info = tstate->exc_info;
25452  tmp_type = exc_info->exc_type;
25453  tmp_value = exc_info->exc_value;
25454  tmp_tb = exc_info->exc_traceback;
25455  exc_info->exc_type = local_type;
25456  exc_info->exc_value = local_value;
25457  exc_info->exc_traceback = local_tb;
25458  }
25459  #else
25460  tmp_type = tstate->exc_type;
25461  tmp_value = tstate->exc_value;
25462  tmp_tb = tstate->exc_traceback;
25463  tstate->exc_type = local_type;
25464  tstate->exc_value = local_value;
25465  tstate->exc_traceback = local_tb;
25466  #endif
25467  Py_XDECREF(tmp_type);
25468  Py_XDECREF(tmp_value);
25469  Py_XDECREF(tmp_tb);
25470 #else
25471  PyErr_SetExcInfo(local_type, local_value, local_tb);
25472 #endif
25473  return 0;
25474 bad:
25475  *type = 0;
25476  *value = 0;
25477  *tb = 0;
25478  Py_XDECREF(local_type);
25479  Py_XDECREF(local_value);
25480  Py_XDECREF(local_tb);
25481  return -1;
25482 }
25483 
25484 /* SwapException */
25485 #if CYTHON_FAST_THREAD_STATE
25486 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25487  PyObject *tmp_type, *tmp_value, *tmp_tb;
25488  #if CYTHON_USE_EXC_INFO_STACK
25489  _PyErr_StackItem *exc_info = tstate->exc_info;
25490  tmp_type = exc_info->exc_type;
25491  tmp_value = exc_info->exc_value;
25492  tmp_tb = exc_info->exc_traceback;
25493  exc_info->exc_type = *type;
25494  exc_info->exc_value = *value;
25495  exc_info->exc_traceback = *tb;
25496  #else
25497  tmp_type = tstate->exc_type;
25498  tmp_value = tstate->exc_value;
25499  tmp_tb = tstate->exc_traceback;
25500  tstate->exc_type = *type;
25501  tstate->exc_value = *value;
25502  tstate->exc_traceback = *tb;
25503  #endif
25504  *type = tmp_type;
25505  *value = tmp_value;
25506  *tb = tmp_tb;
25507 }
25508 #else
25509 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25510  PyObject *tmp_type, *tmp_value, *tmp_tb;
25511  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25512  PyErr_SetExcInfo(*type, *value, *tb);
25513  *type = tmp_type;
25514  *value = tmp_value;
25515  *tb = tmp_tb;
25516 }
25517 #endif
25518 
25519 /* Import */
25520 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25521  PyObject *empty_list = 0;
25522  PyObject *module = 0;
25523  PyObject *global_dict = 0;
25524  PyObject *empty_dict = 0;
25525  PyObject *list;
25526  #if PY_MAJOR_VERSION < 3
25527  PyObject *py_import;
25528  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25529  if (!py_import)
25530  goto bad;
25531  #endif
25532  if (from_list)
25533  list = from_list;
25534  else {
25535  empty_list = PyList_New(0);
25536  if (!empty_list)
25537  goto bad;
25538  list = empty_list;
25539  }
25540  global_dict = PyModule_GetDict(__pyx_m);
25541  if (!global_dict)
25542  goto bad;
25543  empty_dict = PyDict_New();
25544  if (!empty_dict)
25545  goto bad;
25546  {
25547  #if PY_MAJOR_VERSION >= 3
25548  if (level == -1) {
25549  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25550  module = PyImport_ImportModuleLevelObject(
25551  name, global_dict, empty_dict, list, 1);
25552  if (!module) {
25553  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25554  goto bad;
25555  PyErr_Clear();
25556  }
25557  }
25558  level = 0;
25559  }
25560  #endif
25561  if (!module) {
25562  #if PY_MAJOR_VERSION < 3
25563  PyObject *py_level = PyInt_FromLong(level);
25564  if (!py_level)
25565  goto bad;
25566  module = PyObject_CallFunctionObjArgs(py_import,
25567  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25568  Py_DECREF(py_level);
25569  #else
25570  module = PyImport_ImportModuleLevelObject(
25571  name, global_dict, empty_dict, list, level);
25572  #endif
25573  }
25574  }
25575 bad:
25576  #if PY_MAJOR_VERSION < 3
25577  Py_XDECREF(py_import);
25578  #endif
25579  Py_XDECREF(empty_list);
25580  Py_XDECREF(empty_dict);
25581  return module;
25582 }
25583 
25584 /* FastTypeChecks */
25585 #if CYTHON_COMPILING_IN_CPYTHON
25586 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25587  while (a) {
25588  a = a->tp_base;
25589  if (a == b)
25590  return 1;
25591  }
25592  return b == &PyBaseObject_Type;
25593 }
25594 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25595  PyObject *mro;
25596  if (a == b) return 1;
25597  mro = a->tp_mro;
25598  if (likely(mro)) {
25599  Py_ssize_t i, n;
25600  n = PyTuple_GET_SIZE(mro);
25601  for (i = 0; i < n; i++) {
25602  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25603  return 1;
25604  }
25605  return 0;
25606  }
25607  return __Pyx_InBases(a, b);
25608 }
25609 #if PY_MAJOR_VERSION == 2
25610 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25611  PyObject *exception, *value, *tb;
25612  int res;
25613  __Pyx_PyThreadState_declare
25614  __Pyx_PyThreadState_assign
25615  __Pyx_ErrFetch(&exception, &value, &tb);
25616  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25617  if (unlikely(res == -1)) {
25618  PyErr_WriteUnraisable(err);
25619  res = 0;
25620  }
25621  if (!res) {
25622  res = PyObject_IsSubclass(err, exc_type2);
25623  if (unlikely(res == -1)) {
25624  PyErr_WriteUnraisable(err);
25625  res = 0;
25626  }
25627  }
25628  __Pyx_ErrRestore(exception, value, tb);
25629  return res;
25630 }
25631 #else
25632 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25633  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25634  if (!res) {
25635  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25636  }
25637  return res;
25638 }
25639 #endif
25640 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25641  Py_ssize_t i, n;
25642  assert(PyExceptionClass_Check(exc_type));
25643  n = PyTuple_GET_SIZE(tuple);
25644 #if PY_MAJOR_VERSION >= 3
25645  for (i=0; i<n; i++) {
25646  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25647  }
25648 #endif
25649  for (i=0; i<n; i++) {
25650  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25651  #if PY_MAJOR_VERSION < 3
25652  if (likely(exc_type == t)) return 1;
25653  #endif
25654  if (likely(PyExceptionClass_Check(t))) {
25655  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25656  } else {
25657  }
25658  }
25659  return 0;
25660 }
25661 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25662  if (likely(err == exc_type)) return 1;
25663  if (likely(PyExceptionClass_Check(err))) {
25664  if (likely(PyExceptionClass_Check(exc_type))) {
25665  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25666  } else if (likely(PyTuple_Check(exc_type))) {
25667  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25668  } else {
25669  }
25670  }
25671  return PyErr_GivenExceptionMatches(err, exc_type);
25672 }
25673 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25674  assert(PyExceptionClass_Check(exc_type1));
25675  assert(PyExceptionClass_Check(exc_type2));
25676  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25677  if (likely(PyExceptionClass_Check(err))) {
25678  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25679  }
25680  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25681 }
25682 #endif
25683 
25684 /* PyIntBinop */
25685 #if !CYTHON_COMPILING_IN_PYPY
25686 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25687  (void)inplace;
25688  (void)zerodivision_check;
25689  #if PY_MAJOR_VERSION < 3
25690  if (likely(PyInt_CheckExact(op1))) {
25691  const long b = intval;
25692  long x;
25693  long a = PyInt_AS_LONG(op1);
25694  x = (long)((unsigned long)a + b);
25695  if (likely((x^a) >= 0 || (x^b) >= 0))
25696  return PyInt_FromLong(x);
25697  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25698  }
25699  #endif
25700  #if CYTHON_USE_PYLONG_INTERNALS
25701  if (likely(PyLong_CheckExact(op1))) {
25702  const long b = intval;
25703  long a, x;
25704 #ifdef HAVE_LONG_LONG
25705  const PY_LONG_LONG llb = intval;
25706  PY_LONG_LONG lla, llx;
25707 #endif
25708  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25709  const Py_ssize_t size = Py_SIZE(op1);
25710  if (likely(__Pyx_sst_abs(size) <= 1)) {
25711  a = likely(size) ? digits[0] : 0;
25712  if (size == -1) a = -a;
25713  } else {
25714  switch (size) {
25715  case -2:
25716  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25717  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25718  break;
25719 #ifdef HAVE_LONG_LONG
25720  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25721  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25722  goto long_long;
25723 #endif
25724  }
25725  CYTHON_FALLTHROUGH;
25726  case 2:
25727  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25728  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25729  break;
25730 #ifdef HAVE_LONG_LONG
25731  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25732  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25733  goto long_long;
25734 #endif
25735  }
25736  CYTHON_FALLTHROUGH;
25737  case -3:
25738  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25739  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25740  break;
25741 #ifdef HAVE_LONG_LONG
25742  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25743  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25744  goto long_long;
25745 #endif
25746  }
25747  CYTHON_FALLTHROUGH;
25748  case 3:
25749  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25750  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25751  break;
25752 #ifdef HAVE_LONG_LONG
25753  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25754  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25755  goto long_long;
25756 #endif
25757  }
25758  CYTHON_FALLTHROUGH;
25759  case -4:
25760  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25761  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25762  break;
25763 #ifdef HAVE_LONG_LONG
25764  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25765  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25766  goto long_long;
25767 #endif
25768  }
25769  CYTHON_FALLTHROUGH;
25770  case 4:
25771  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25772  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25773  break;
25774 #ifdef HAVE_LONG_LONG
25775  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25776  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25777  goto long_long;
25778 #endif
25779  }
25780  CYTHON_FALLTHROUGH;
25781  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25782  }
25783  }
25784  x = a + b;
25785  return PyLong_FromLong(x);
25786 #ifdef HAVE_LONG_LONG
25787  long_long:
25788  llx = lla + llb;
25789  return PyLong_FromLongLong(llx);
25790 #endif
25791 
25792 
25793  }
25794  #endif
25795  if (PyFloat_CheckExact(op1)) {
25796  const long b = intval;
25797  double a = PyFloat_AS_DOUBLE(op1);
25798  double result;
25799  PyFPE_START_PROTECT("add", return NULL)
25800  result = ((double)a) + (double)b;
25801  PyFPE_END_PROTECT(result)
25802  return PyFloat_FromDouble(result);
25803  }
25804  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25805 }
25806 #endif
25807 
25808 /* None */
25809 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25810  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25811 }
25812 
25813 /* ImportFrom */
25814 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25815  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25816  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25817  PyErr_Format(PyExc_ImportError,
25818  #if PY_MAJOR_VERSION < 3
25819  "cannot import name %.230s", PyString_AS_STRING(name));
25820  #else
25821  "cannot import name %S", name);
25822  #endif
25823  }
25824  return value;
25825 }
25826 
25827 /* HasAttr */
25828 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25829  PyObject *r;
25830  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25831  PyErr_SetString(PyExc_TypeError,
25832  "hasattr(): attribute name must be string");
25833  return -1;
25834  }
25835  r = __Pyx_GetAttr(o, n);
25836  if (unlikely(!r)) {
25837  PyErr_Clear();
25838  return 0;
25839  } else {
25840  Py_DECREF(r);
25841  return 1;
25842  }
25843 }
25844 
25845 /* CallNextTpDealloc */
25846 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25847  PyTypeObject* type = Py_TYPE(obj);
25848  while (type && type->tp_dealloc != current_tp_dealloc)
25849  type = type->tp_base;
25850  while (type && type->tp_dealloc == current_tp_dealloc)
25851  type = type->tp_base;
25852  if (type)
25853  type->tp_dealloc(obj);
25854 }
25855 
25856 /* CallNextTpTraverse */
25857 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
25858  PyTypeObject* type = Py_TYPE(obj);
25859  while (type && type->tp_traverse != current_tp_traverse)
25860  type = type->tp_base;
25861  while (type && type->tp_traverse == current_tp_traverse)
25862  type = type->tp_base;
25863  if (type && type->tp_traverse)
25864  return type->tp_traverse(obj, v, a);
25865  return 0;
25866 }
25867 
25868 /* CallNextTpClear */
25869 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25870  PyTypeObject* type = Py_TYPE(obj);
25871  while (type && type->tp_clear != current_tp_clear)
25872  type = type->tp_base;
25873  while (type && type->tp_clear == current_tp_clear)
25874  type = type->tp_base;
25875  if (type && type->tp_clear)
25876  type->tp_clear(obj);
25877 }
25878 
25879 /* PyObject_GenericGetAttrNoDict */
25880 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25881 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25882  PyErr_Format(PyExc_AttributeError,
25883 #if PY_MAJOR_VERSION >= 3
25884  "'%.50s' object has no attribute '%U'",
25885  tp->tp_name, attr_name);
25886 #else
25887  "'%.50s' object has no attribute '%.400s'",
25888  tp->tp_name, PyString_AS_STRING(attr_name));
25889 #endif
25890  return NULL;
25891 }
25892 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25893  PyObject *descr;
25894  PyTypeObject *tp = Py_TYPE(obj);
25895  if (unlikely(!PyString_Check(attr_name))) {
25896  return PyObject_GenericGetAttr(obj, attr_name);
25897  }
25898  assert(!tp->tp_dictoffset);
25899  descr = _PyType_Lookup(tp, attr_name);
25900  if (unlikely(!descr)) {
25901  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25902  }
25903  Py_INCREF(descr);
25904  #if PY_MAJOR_VERSION < 3
25905  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25906  #endif
25907  {
25908  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25909  if (unlikely(f)) {
25910  PyObject *res = f(descr, obj, (PyObject *)tp);
25911  Py_DECREF(descr);
25912  return res;
25913  }
25914  }
25915  return descr;
25916 }
25917 #endif
25918 
25919 /* PyObject_GenericGetAttr */
25920 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25921 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25922  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25923  return PyObject_GenericGetAttr(obj, attr_name);
25924  }
25925  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25926 }
25927 #endif
25928 
25929 /* TypeImport */
25930 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
25931 #define __PYX_HAVE_RT_ImportType_0_29_36
25932 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name,
25933  size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
25934 {
25935  PyObject *result = 0;
25936  char warning[200];
25937  Py_ssize_t basicsize;
25938  Py_ssize_t itemsize;
25939 #ifdef Py_LIMITED_API
25940  PyObject *py_basicsize;
25941  PyObject *py_itemsize;
25942 #endif
25943  result = PyObject_GetAttrString(module, class_name);
25944  if (!result)
25945  goto bad;
25946  if (!PyType_Check(result)) {
25947  PyErr_Format(PyExc_TypeError,
25948  "%.200s.%.200s is not a type object",
25949  module_name, class_name);
25950  goto bad;
25951  }
25952 #ifndef Py_LIMITED_API
25953  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25954  itemsize = ((PyTypeObject *)result)->tp_itemsize;
25955 #else
25956  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25957  if (!py_basicsize)
25958  goto bad;
25959  basicsize = PyLong_AsSsize_t(py_basicsize);
25960  Py_DECREF(py_basicsize);
25961  py_basicsize = 0;
25962  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25963  goto bad;
25964  py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
25965  if (!py_itemsize)
25966  goto bad;
25967  itemsize = PyLong_AsSsize_t(py_itemsize);
25968  Py_DECREF(py_itemsize);
25969  py_itemsize = 0;
25970  if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
25971  goto bad;
25972 #endif
25973  if (itemsize) {
25974  if (size % alignment) {
25975  alignment = size % alignment;
25976  }
25977  if (itemsize < (Py_ssize_t)alignment)
25978  itemsize = (Py_ssize_t)alignment;
25979  }
25980  if ((size_t)(basicsize + itemsize) < size) {
25981  PyErr_Format(PyExc_ValueError,
25982  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25983  "Expected %zd from C header, got %zd from PyObject",
25984  module_name, class_name, size, basicsize);
25985  goto bad;
25986  }
25987  if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) {
25988  PyErr_Format(PyExc_ValueError,
25989  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25990  "Expected %zd from C header, got %zd from PyObject",
25991  module_name, class_name, size, basicsize);
25992  goto bad;
25993  }
25994  else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) {
25995  PyOS_snprintf(warning, sizeof(warning),
25996  "%s.%s size changed, may indicate binary incompatibility. "
25997  "Expected %zd from C header, got %zd from PyObject",
25998  module_name, class_name, size, basicsize);
25999  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
26000  }
26001  return (PyTypeObject *)result;
26002 bad:
26003  Py_XDECREF(result);
26004  return NULL;
26005 }
26006 #endif
26007 
26008 /* GetVTable */
26009 static void* __Pyx_GetVtable(PyObject *dict) {
26010  void* ptr;
26011  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
26012  if (!ob)
26013  goto bad;
26014 #if PY_VERSION_HEX >= 0x02070000
26015  ptr = PyCapsule_GetPointer(ob, 0);
26016 #else
26017  ptr = PyCObject_AsVoidPtr(ob);
26018 #endif
26019  if (!ptr && !PyErr_Occurred())
26020  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
26021  Py_DECREF(ob);
26022  return ptr;
26023 bad:
26024  Py_XDECREF(ob);
26025  return NULL;
26026 }
26027 
26028 /* SetVTable */
26029 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26030 #if PY_VERSION_HEX >= 0x02070000
26031  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26032 #else
26033  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26034 #endif
26035  if (!ob)
26036  goto bad;
26037  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26038  goto bad;
26039  Py_DECREF(ob);
26040  return 0;
26041 bad:
26042  Py_XDECREF(ob);
26043  return -1;
26044 }
26045 
26046 /* PyObjectGetAttrStrNoError */
26047 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
26048  __Pyx_PyThreadState_declare
26049  __Pyx_PyThreadState_assign
26050  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26051  __Pyx_PyErr_Clear();
26052 }
26053 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26054  PyObject *result;
26055 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26056  PyTypeObject* tp = Py_TYPE(obj);
26057  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26058  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26059  }
26060 #endif
26061  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26062  if (unlikely(!result)) {
26063  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26064  }
26065  return result;
26066 }
26067 
26068 /* SetupReduce */
26069 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26070  int ret;
26071  PyObject *name_attr;
26072  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26073  if (likely(name_attr)) {
26074  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26075  } else {
26076  ret = -1;
26077  }
26078  if (unlikely(ret < 0)) {
26079  PyErr_Clear();
26080  ret = 0;
26081  }
26082  Py_XDECREF(name_attr);
26083  return ret;
26084 }
26085 static int __Pyx_setup_reduce(PyObject* type_obj) {
26086  int ret = 0;
26087  PyObject *object_reduce = NULL;
26088  PyObject *object_getstate = NULL;
26089  PyObject *object_reduce_ex = NULL;
26090  PyObject *reduce = NULL;
26091  PyObject *reduce_ex = NULL;
26092  PyObject *reduce_cython = NULL;
26093  PyObject *setstate = NULL;
26094  PyObject *setstate_cython = NULL;
26095  PyObject *getstate = NULL;
26096 #if CYTHON_USE_PYTYPE_LOOKUP
26097  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26098 #else
26099  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26100  if (!getstate && PyErr_Occurred()) {
26101  goto __PYX_BAD;
26102  }
26103 #endif
26104  if (getstate) {
26105 #if CYTHON_USE_PYTYPE_LOOKUP
26106  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26107 #else
26108  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26109  if (!object_getstate && PyErr_Occurred()) {
26110  goto __PYX_BAD;
26111  }
26112 #endif
26113  if (object_getstate != getstate) {
26114  goto __PYX_GOOD;
26115  }
26116  }
26117 #if CYTHON_USE_PYTYPE_LOOKUP
26118  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26119 #else
26120  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26121 #endif
26122  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
26123  if (reduce_ex == object_reduce_ex) {
26124 #if CYTHON_USE_PYTYPE_LOOKUP
26125  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26126 #else
26127  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26128 #endif
26129  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
26130  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26131  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26132  if (likely(reduce_cython)) {
26133  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26134  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26135  } else if (reduce == object_reduce || PyErr_Occurred()) {
26136  goto __PYX_BAD;
26137  }
26138  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26139  if (!setstate) PyErr_Clear();
26140  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26141  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26142  if (likely(setstate_cython)) {
26143  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26144  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26145  } else if (!setstate || PyErr_Occurred()) {
26146  goto __PYX_BAD;
26147  }
26148  }
26149  PyType_Modified((PyTypeObject*)type_obj);
26150  }
26151  }
26152  goto __PYX_GOOD;
26153 __PYX_BAD:
26154  if (!PyErr_Occurred())
26155  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26156  ret = -1;
26157 __PYX_GOOD:
26158 #if !CYTHON_USE_PYTYPE_LOOKUP
26159  Py_XDECREF(object_reduce);
26160  Py_XDECREF(object_reduce_ex);
26161  Py_XDECREF(object_getstate);
26162  Py_XDECREF(getstate);
26163 #endif
26164  Py_XDECREF(reduce);
26165  Py_XDECREF(reduce_ex);
26166  Py_XDECREF(reduce_cython);
26167  Py_XDECREF(setstate);
26168  Py_XDECREF(setstate_cython);
26169  return ret;
26170 }
26171 
26172 /* FetchCommonType */
26173 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26174  PyObject* fake_module;
26175  PyTypeObject* cached_type = NULL;
26176  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
26177  if (!fake_module) return NULL;
26178  Py_INCREF(fake_module);
26179  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26180  if (cached_type) {
26181  if (!PyType_Check((PyObject*)cached_type)) {
26182  PyErr_Format(PyExc_TypeError,
26183  "Shared Cython type %.200s is not a type object",
26184  type->tp_name);
26185  goto bad;
26186  }
26187  if (cached_type->tp_basicsize != type->tp_basicsize) {
26188  PyErr_Format(PyExc_TypeError,
26189  "Shared Cython type %.200s has the wrong size, try recompiling",
26190  type->tp_name);
26191  goto bad;
26192  }
26193  } else {
26194  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
26195  PyErr_Clear();
26196  if (PyType_Ready(type) < 0) goto bad;
26197  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26198  goto bad;
26199  Py_INCREF(type);
26200  cached_type = type;
26201  }
26202 done:
26203  Py_DECREF(fake_module);
26204  return cached_type;
26205 bad:
26206  Py_XDECREF(cached_type);
26207  cached_type = NULL;
26208  goto done;
26209 }
26210 
26211 /* CythonFunctionShared */
26212 #include <structmember.h>
26213 static PyObject *
26214 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
26215 {
26216  if (unlikely(op->func_doc == NULL)) {
26217  if (op->func.m_ml->ml_doc) {
26218 #if PY_MAJOR_VERSION >= 3
26219  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26220 #else
26221  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26222 #endif
26223  if (unlikely(op->func_doc == NULL))
26224  return NULL;
26225  } else {
26226  Py_INCREF(Py_None);
26227  return Py_None;
26228  }
26229  }
26230  Py_INCREF(op->func_doc);
26231  return op->func_doc;
26232 }
26233 static int
26234 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26235 {
26236  PyObject *tmp = op->func_doc;
26237  if (value == NULL) {
26238  value = Py_None;
26239  }
26240  Py_INCREF(value);
26241  op->func_doc = value;
26242  Py_XDECREF(tmp);
26243  return 0;
26244 }
26245 static PyObject *
26246 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26247 {
26248  if (unlikely(op->func_name == NULL)) {
26249 #if PY_MAJOR_VERSION >= 3
26250  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26251 #else
26252  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26253 #endif
26254  if (unlikely(op->func_name == NULL))
26255  return NULL;
26256  }
26257  Py_INCREF(op->func_name);
26258  return op->func_name;
26259 }
26260 static int
26261 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26262 {
26263  PyObject *tmp;
26264 #if PY_MAJOR_VERSION >= 3
26265  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26266 #else
26267  if (unlikely(value == NULL || !PyString_Check(value)))
26268 #endif
26269  {
26270  PyErr_SetString(PyExc_TypeError,
26271  "__name__ must be set to a string object");
26272  return -1;
26273  }
26274  tmp = op->func_name;
26275  Py_INCREF(value);
26276  op->func_name = value;
26277  Py_XDECREF(tmp);
26278  return 0;
26279 }
26280 static PyObject *
26281 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26282 {
26283  Py_INCREF(op->func_qualname);
26284  return op->func_qualname;
26285 }
26286 static int
26287 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26288 {
26289  PyObject *tmp;
26290 #if PY_MAJOR_VERSION >= 3
26291  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26292 #else
26293  if (unlikely(value == NULL || !PyString_Check(value)))
26294 #endif
26295  {
26296  PyErr_SetString(PyExc_TypeError,
26297  "__qualname__ must be set to a string object");
26298  return -1;
26299  }
26300  tmp = op->func_qualname;
26301  Py_INCREF(value);
26302  op->func_qualname = value;
26303  Py_XDECREF(tmp);
26304  return 0;
26305 }
26306 static PyObject *
26307 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
26308 {
26309  PyObject *self;
26310  self = m->func_closure;
26311  if (self == NULL)
26312  self = Py_None;
26313  Py_INCREF(self);
26314  return self;
26315 }
26316 static PyObject *
26317 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26318 {
26319  if (unlikely(op->func_dict == NULL)) {
26320  op->func_dict = PyDict_New();
26321  if (unlikely(op->func_dict == NULL))
26322  return NULL;
26323  }
26324  Py_INCREF(op->func_dict);
26325  return op->func_dict;
26326 }
26327 static int
26328 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26329 {
26330  PyObject *tmp;
26331  if (unlikely(value == NULL)) {
26332  PyErr_SetString(PyExc_TypeError,
26333  "function's dictionary may not be deleted");
26334  return -1;
26335  }
26336  if (unlikely(!PyDict_Check(value))) {
26337  PyErr_SetString(PyExc_TypeError,
26338  "setting function's dictionary to a non-dict");
26339  return -1;
26340  }
26341  tmp = op->func_dict;
26342  Py_INCREF(value);
26343  op->func_dict = value;
26344  Py_XDECREF(tmp);
26345  return 0;
26346 }
26347 static PyObject *
26348 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26349 {
26350  Py_INCREF(op->func_globals);
26351  return op->func_globals;
26352 }
26353 static PyObject *
26354 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26355 {
26356  Py_INCREF(Py_None);
26357  return Py_None;
26358 }
26359 static PyObject *
26360 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26361 {
26362  PyObject* result = (op->func_code) ? op->func_code : Py_None;
26363  Py_INCREF(result);
26364  return result;
26365 }
26366 static int
26367 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26368  int result = 0;
26369  PyObject *res = op->defaults_getter((PyObject *) op);
26370  if (unlikely(!res))
26371  return -1;
26372  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26373  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26374  Py_INCREF(op->defaults_tuple);
26375  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26376  Py_INCREF(op->defaults_kwdict);
26377  #else
26378  op->defaults_tuple = PySequence_ITEM(res, 0);
26379  if (unlikely(!op->defaults_tuple)) result = -1;
26380  else {
26381  op->defaults_kwdict = PySequence_ITEM(res, 1);
26382  if (unlikely(!op->defaults_kwdict)) result = -1;
26383  }
26384  #endif
26385  Py_DECREF(res);
26386  return result;
26387 }
26388 static int
26389 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26390  PyObject* tmp;
26391  if (!value) {
26392  value = Py_None;
26393  } else if (value != Py_None && !PyTuple_Check(value)) {
26394  PyErr_SetString(PyExc_TypeError,
26395  "__defaults__ must be set to a tuple object");
26396  return -1;
26397  }
26398  Py_INCREF(value);
26399  tmp = op->defaults_tuple;
26400  op->defaults_tuple = value;
26401  Py_XDECREF(tmp);
26402  return 0;
26403 }
26404 static PyObject *
26405 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26406  PyObject* result = op->defaults_tuple;
26407  if (unlikely(!result)) {
26408  if (op->defaults_getter) {
26409  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26410  result = op->defaults_tuple;
26411  } else {
26412  result = Py_None;
26413  }
26414  }
26415  Py_INCREF(result);
26416  return result;
26417 }
26418 static int
26419 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26420  PyObject* tmp;
26421  if (!value) {
26422  value = Py_None;
26423  } else if (value != Py_None && !PyDict_Check(value)) {
26424  PyErr_SetString(PyExc_TypeError,
26425  "__kwdefaults__ must be set to a dict object");
26426  return -1;
26427  }
26428  Py_INCREF(value);
26429  tmp = op->defaults_kwdict;
26430  op->defaults_kwdict = value;
26431  Py_XDECREF(tmp);
26432  return 0;
26433 }
26434 static PyObject *
26435 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26436  PyObject* result = op->defaults_kwdict;
26437  if (unlikely(!result)) {
26438  if (op->defaults_getter) {
26439  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26440  result = op->defaults_kwdict;
26441  } else {
26442  result = Py_None;
26443  }
26444  }
26445  Py_INCREF(result);
26446  return result;
26447 }
26448 static int
26449 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26450  PyObject* tmp;
26451  if (!value || value == Py_None) {
26452  value = NULL;
26453  } else if (!PyDict_Check(value)) {
26454  PyErr_SetString(PyExc_TypeError,
26455  "__annotations__ must be set to a dict object");
26456  return -1;
26457  }
26458  Py_XINCREF(value);
26459  tmp = op->func_annotations;
26460  op->func_annotations = value;
26461  Py_XDECREF(tmp);
26462  return 0;
26463 }
26464 static PyObject *
26465 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26466  PyObject* result = op->func_annotations;
26467  if (unlikely(!result)) {
26468  result = PyDict_New();
26469  if (unlikely(!result)) return NULL;
26470  op->func_annotations = result;
26471  }
26472  Py_INCREF(result);
26473  return result;
26474 }
26475 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26476  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26477  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26478  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26479  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26480  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26481  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26482  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26483  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26484  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26485  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26486  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26487  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26488  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26489  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26490  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26491  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26492  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26493  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26494  {0, 0, 0, 0, 0}
26495 };
26496 static PyMemberDef __pyx_CyFunction_members[] = {
26497  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26498  {0, 0, 0, 0, 0}
26499 };
26500 static PyObject *
26501 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26502 {
26503 #if PY_MAJOR_VERSION >= 3
26504  Py_INCREF(m->func_qualname);
26505  return m->func_qualname;
26506 #else
26507  return PyString_FromString(m->func.m_ml->ml_name);
26508 #endif
26509 }
26510 static PyMethodDef __pyx_CyFunction_methods[] = {
26511  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26512  {0, 0, 0, 0}
26513 };
26514 #if PY_VERSION_HEX < 0x030500A0
26515 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26516 #else
26517 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26518 #endif
26519 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
26520  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26521  if (unlikely(op == NULL))
26522  return NULL;
26523  op->flags = flags;
26524  __Pyx_CyFunction_weakreflist(op) = NULL;
26525  op->func.m_ml = ml;
26526  op->func.m_self = (PyObject *) op;
26527  Py_XINCREF(closure);
26528  op->func_closure = closure;
26529  Py_XINCREF(module);
26530  op->func.m_module = module;
26531  op->func_dict = NULL;
26532  op->func_name = NULL;
26533  Py_INCREF(qualname);
26534  op->func_qualname = qualname;
26535  op->func_doc = NULL;
26536  op->func_classobj = NULL;
26537  op->func_globals = globals;
26538  Py_INCREF(op->func_globals);
26539  Py_XINCREF(code);
26540  op->func_code = code;
26541  op->defaults_pyobjects = 0;
26542  op->defaults_size = 0;
26543  op->defaults = NULL;
26544  op->defaults_tuple = NULL;
26545  op->defaults_kwdict = NULL;
26546  op->defaults_getter = NULL;
26547  op->func_annotations = NULL;
26548  return (PyObject *) op;
26549 }
26550 static int
26551 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26552 {
26553  Py_CLEAR(m->func_closure);
26554  Py_CLEAR(m->func.m_module);
26555  Py_CLEAR(m->func_dict);
26556  Py_CLEAR(m->func_name);
26557  Py_CLEAR(m->func_qualname);
26558  Py_CLEAR(m->func_doc);
26559  Py_CLEAR(m->func_globals);
26560  Py_CLEAR(m->func_code);
26561  Py_CLEAR(m->func_classobj);
26562  Py_CLEAR(m->defaults_tuple);
26563  Py_CLEAR(m->defaults_kwdict);
26564  Py_CLEAR(m->func_annotations);
26565  if (m->defaults) {
26566  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26567  int i;
26568  for (i = 0; i < m->defaults_pyobjects; i++)
26569  Py_XDECREF(pydefaults[i]);
26570  PyObject_Free(m->defaults);
26571  m->defaults = NULL;
26572  }
26573  return 0;
26574 }
26575 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26576 {
26577  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26578  PyObject_ClearWeakRefs((PyObject *) m);
26579  __Pyx_CyFunction_clear(m);
26580  PyObject_GC_Del(m);
26581 }
26582 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26583 {
26584  PyObject_GC_UnTrack(m);
26585  __Pyx__CyFunction_dealloc(m);
26586 }
26587 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26588 {
26589  Py_VISIT(m->func_closure);
26590  Py_VISIT(m->func.m_module);
26591  Py_VISIT(m->func_dict);
26592  Py_VISIT(m->func_name);
26593  Py_VISIT(m->func_qualname);
26594  Py_VISIT(m->func_doc);
26595  Py_VISIT(m->func_globals);
26596  Py_VISIT(m->func_code);
26597  Py_VISIT(m->func_classobj);
26598  Py_VISIT(m->defaults_tuple);
26599  Py_VISIT(m->defaults_kwdict);
26600  if (m->defaults) {
26601  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26602  int i;
26603  for (i = 0; i < m->defaults_pyobjects; i++)
26604  Py_VISIT(pydefaults[i]);
26605  }
26606  return 0;
26607 }
26608 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26609 {
26610 #if PY_MAJOR_VERSION < 3
26611  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26612  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26613  Py_INCREF(func);
26614  return func;
26615  }
26616  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26617  if (type == NULL)
26618  type = (PyObject *)(Py_TYPE(obj));
26619  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26620  }
26621  if (obj == Py_None)
26622  obj = NULL;
26623 #endif
26624  return __Pyx_PyMethod_New(func, obj, type);
26625 }
26626 static PyObject*
26627 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26628 {
26629 #if PY_MAJOR_VERSION >= 3
26630  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26631  op->func_qualname, (void *)op);
26632 #else
26633  return PyString_FromFormat("<cyfunction %s at %p>",
26634  PyString_AsString(op->func_qualname), (void *)op);
26635 #endif
26636 }
26637 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26638  PyCFunctionObject* f = (PyCFunctionObject*)func;
26639  PyCFunction meth = f->m_ml->ml_meth;
26640  Py_ssize_t size;
26641  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26642  case METH_VARARGS:
26643  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26644  return (*meth)(self, arg);
26645  break;
26646  case METH_VARARGS | METH_KEYWORDS:
26647  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26648  case METH_NOARGS:
26649  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26650  size = PyTuple_GET_SIZE(arg);
26651  if (likely(size == 0))
26652  return (*meth)(self, NULL);
26653  PyErr_Format(PyExc_TypeError,
26654  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26655  f->m_ml->ml_name, size);
26656  return NULL;
26657  }
26658  break;
26659  case METH_O:
26660  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26661  size = PyTuple_GET_SIZE(arg);
26662  if (likely(size == 1)) {
26663  PyObject *result, *arg0;
26664  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26665  arg0 = PyTuple_GET_ITEM(arg, 0);
26666  #else
26667  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26668  #endif
26669  result = (*meth)(self, arg0);
26670  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26671  Py_DECREF(arg0);
26672  #endif
26673  return result;
26674  }
26675  PyErr_Format(PyExc_TypeError,
26676  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26677  f->m_ml->ml_name, size);
26678  return NULL;
26679  }
26680  break;
26681  default:
26682  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26683  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26684  "longer supported!");
26685  return NULL;
26686  }
26687  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26688  f->m_ml->ml_name);
26689  return NULL;
26690 }
26691 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26692  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26693 }
26694 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26695  PyObject *result;
26696  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26697  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26698  Py_ssize_t argc;
26699  PyObject *new_args;
26700  PyObject *self;
26701  argc = PyTuple_GET_SIZE(args);
26702  new_args = PyTuple_GetSlice(args, 1, argc);
26703  if (unlikely(!new_args))
26704  return NULL;
26705  self = PyTuple_GetItem(args, 0);
26706  if (unlikely(!self)) {
26707  Py_DECREF(new_args);
26708 #if PY_MAJOR_VERSION > 2
26709  PyErr_Format(PyExc_TypeError,
26710  "unbound method %.200S() needs an argument",
26711  cyfunc->func_qualname);
26712 #else
26713  PyErr_SetString(PyExc_TypeError,
26714  "unbound method needs an argument");
26715 #endif
26716  return NULL;
26717  }
26718  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26719  Py_DECREF(new_args);
26720  } else {
26721  result = __Pyx_CyFunction_Call(func, args, kw);
26722  }
26723  return result;
26724 }
26725 static PyTypeObject __pyx_CyFunctionType_type = {
26726  PyVarObject_HEAD_INIT(0, 0)
26727  "cython_function_or_method",
26728  sizeof(__pyx_CyFunctionObject),
26729  0,
26730  (destructor) __Pyx_CyFunction_dealloc,
26731  0,
26732  0,
26733  0,
26734 #if PY_MAJOR_VERSION < 3
26735  0,
26736 #else
26737  0,
26738 #endif
26739  (reprfunc) __Pyx_CyFunction_repr,
26740  0,
26741  0,
26742  0,
26743  0,
26744  __Pyx_CyFunction_CallAsMethod,
26745  0,
26746  0,
26747  0,
26748  0,
26749  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26750  0,
26751  (traverseproc) __Pyx_CyFunction_traverse,
26752  (inquiry) __Pyx_CyFunction_clear,
26753  0,
26754 #if PY_VERSION_HEX < 0x030500A0
26755  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26756 #else
26757  offsetof(PyCFunctionObject, m_weakreflist),
26758 #endif
26759  0,
26760  0,
26761  __pyx_CyFunction_methods,
26762  __pyx_CyFunction_members,
26763  __pyx_CyFunction_getsets,
26764  0,
26765  0,
26766  __Pyx_CyFunction_descr_get,
26767  0,
26768  offsetof(__pyx_CyFunctionObject, func_dict),
26769  0,
26770  0,
26771  0,
26772  0,
26773  0,
26774  0,
26775  0,
26776  0,
26777  0,
26778  0,
26779  0,
26780  0,
26781 #if PY_VERSION_HEX >= 0x030400a1
26782  0,
26783 #endif
26784 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26785  0,
26786 #endif
26787 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26788  0,
26789 #endif
26790 #if PY_VERSION_HEX >= 0x030C0000
26791  0,
26792 #endif
26793 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26794  0,
26795 #endif
26796 };
26797 static int __pyx_CyFunction_init(void) {
26798  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26799  if (unlikely(__pyx_CyFunctionType == NULL)) {
26800  return -1;
26801  }
26802  return 0;
26803 }
26804 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26805  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26806  m->defaults = PyObject_Malloc(size);
26807  if (unlikely(!m->defaults))
26808  return PyErr_NoMemory();
26809  memset(m->defaults, 0, size);
26810  m->defaults_pyobjects = pyobjects;
26811  m->defaults_size = size;
26812  return m->defaults;
26813 }
26814 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26815  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26816  m->defaults_tuple = tuple;
26817  Py_INCREF(tuple);
26818 }
26819 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26820  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26821  m->defaults_kwdict = dict;
26822  Py_INCREF(dict);
26823 }
26824 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26825  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26826  m->func_annotations = dict;
26827  Py_INCREF(dict);
26828 }
26829 
26830 /* CythonFunction */
26831 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26832  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26833  PyObject *op = __Pyx_CyFunction_Init(
26834  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26835  ml, flags, qualname, closure, module, globals, code
26836  );
26837  if (likely(op)) {
26838  PyObject_GC_Track(op);
26839  }
26840  return op;
26841 }
26842 
26843 /* CLineInTraceback */
26844 #ifndef CYTHON_CLINE_IN_TRACEBACK
26845 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
26846  PyObject *use_cline;
26847  PyObject *ptype, *pvalue, *ptraceback;
26848 #if CYTHON_COMPILING_IN_CPYTHON
26849  PyObject **cython_runtime_dict;
26850 #endif
26851  if (unlikely(!__pyx_cython_runtime)) {
26852  return c_line;
26853  }
26854  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26855 #if CYTHON_COMPILING_IN_CPYTHON
26856  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26857  if (likely(cython_runtime_dict)) {
26858  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26859  use_cline, *cython_runtime_dict,
26860  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26861  } else
26862 #endif
26863  {
26864  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26865  if (use_cline_obj) {
26866  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26867  Py_DECREF(use_cline_obj);
26868  } else {
26869  PyErr_Clear();
26870  use_cline = NULL;
26871  }
26872  }
26873  if (!use_cline) {
26874  c_line = 0;
26875  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26876  }
26877  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26878  c_line = 0;
26879  }
26880  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26881  return c_line;
26882 }
26883 #endif
26884 
26885 /* CodeObjectCache */
26886 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26887  int start = 0, mid = 0, end = count - 1;
26888  if (end >= 0 && code_line > entries[end].code_line) {
26889  return count;
26890  }
26891  while (start < end) {
26892  mid = start + (end - start) / 2;
26893  if (code_line < entries[mid].code_line) {
26894  end = mid;
26895  } else if (code_line > entries[mid].code_line) {
26896  start = mid + 1;
26897  } else {
26898  return mid;
26899  }
26900  }
26901  if (code_line <= entries[mid].code_line) {
26902  return mid;
26903  } else {
26904  return mid + 1;
26905  }
26906 }
26907 static PyCodeObject *__pyx_find_code_object(int code_line) {
26908  PyCodeObject* code_object;
26909  int pos;
26910  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26911  return NULL;
26912  }
26913  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26914  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26915  return NULL;
26916  }
26917  code_object = __pyx_code_cache.entries[pos].code_object;
26918  Py_INCREF(code_object);
26919  return code_object;
26920 }
26921 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26922  int pos, i;
26923  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26924  if (unlikely(!code_line)) {
26925  return;
26926  }
26927  if (unlikely(!entries)) {
26928  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26929  if (likely(entries)) {
26930  __pyx_code_cache.entries = entries;
26931  __pyx_code_cache.max_count = 64;
26932  __pyx_code_cache.count = 1;
26933  entries[0].code_line = code_line;
26934  entries[0].code_object = code_object;
26935  Py_INCREF(code_object);
26936  }
26937  return;
26938  }
26939  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26940  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26941  PyCodeObject* tmp = entries[pos].code_object;
26942  entries[pos].code_object = code_object;
26943  Py_DECREF(tmp);
26944  return;
26945  }
26946  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26947  int new_max = __pyx_code_cache.max_count + 64;
26948  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26949  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26950  if (unlikely(!entries)) {
26951  return;
26952  }
26953  __pyx_code_cache.entries = entries;
26954  __pyx_code_cache.max_count = new_max;
26955  }
26956  for (i=__pyx_code_cache.count; i>pos; i--) {
26957  entries[i] = entries[i-1];
26958  }
26959  entries[pos].code_line = code_line;
26960  entries[pos].code_object = code_object;
26961  __pyx_code_cache.count++;
26962  Py_INCREF(code_object);
26963 }
26964 
26965 /* AddTraceback */
26966 #include "compile.h"
26967 #include "frameobject.h"
26968 #include "traceback.h"
26969 #if PY_VERSION_HEX >= 0x030b00a6
26970  #ifndef Py_BUILD_CORE
26971  #define Py_BUILD_CORE 1
26972  #endif
26973  #include "internal/pycore_frame.h"
26974 #endif
26975 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26976  const char *funcname, int c_line,
26977  int py_line, const char *filename) {
26978  PyCodeObject *py_code = NULL;
26979  PyObject *py_funcname = NULL;
26980  #if PY_MAJOR_VERSION < 3
26981  PyObject *py_srcfile = NULL;
26982  py_srcfile = PyString_FromString(filename);
26983  if (!py_srcfile) goto bad;
26984  #endif
26985  if (c_line) {
26986  #if PY_MAJOR_VERSION < 3
26987  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26988  if (!py_funcname) goto bad;
26989  #else
26990  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26991  if (!py_funcname) goto bad;
26992  funcname = PyUnicode_AsUTF8(py_funcname);
26993  if (!funcname) goto bad;
26994  #endif
26995  }
26996  else {
26997  #if PY_MAJOR_VERSION < 3
26998  py_funcname = PyString_FromString(funcname);
26999  if (!py_funcname) goto bad;
27000  #endif
27001  }
27002  #if PY_MAJOR_VERSION < 3
27003  py_code = __Pyx_PyCode_New(
27004  0,
27005  0,
27006  0,
27007  0,
27008  0,
27009  __pyx_empty_bytes, /*PyObject *code,*/
27010  __pyx_empty_tuple, /*PyObject *consts,*/
27011  __pyx_empty_tuple, /*PyObject *names,*/
27012  __pyx_empty_tuple, /*PyObject *varnames,*/
27013  __pyx_empty_tuple, /*PyObject *freevars,*/
27014  __pyx_empty_tuple, /*PyObject *cellvars,*/
27015  py_srcfile, /*PyObject *filename,*/
27016  py_funcname, /*PyObject *name,*/
27017  py_line,
27018  __pyx_empty_bytes /*PyObject *lnotab*/
27019  );
27020  Py_DECREF(py_srcfile);
27021  #else
27022  py_code = PyCode_NewEmpty(filename, funcname, py_line);
27023  #endif
27024  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
27025  return py_code;
27026 bad:
27027  Py_XDECREF(py_funcname);
27028  #if PY_MAJOR_VERSION < 3
27029  Py_XDECREF(py_srcfile);
27030  #endif
27031  return NULL;
27032 }
27033 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27034  int py_line, const char *filename) {
27035  PyCodeObject *py_code = 0;
27036  PyFrameObject *py_frame = 0;
27037  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27038  PyObject *ptype, *pvalue, *ptraceback;
27039  if (c_line) {
27040  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27041  }
27042  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27043  if (!py_code) {
27044  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27045  py_code = __Pyx_CreateCodeObjectForTraceback(
27046  funcname, c_line, py_line, filename);
27047  if (!py_code) {
27048  /* If the code object creation fails, then we should clear the
27049  fetched exception references and propagate the new exception */
27050  Py_XDECREF(ptype);
27051  Py_XDECREF(pvalue);
27052  Py_XDECREF(ptraceback);
27053  goto bad;
27054  }
27055  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27056  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27057  }
27058  py_frame = PyFrame_New(
27059  tstate, /*PyThreadState *tstate,*/
27060  py_code, /*PyCodeObject *code,*/
27061  __pyx_d, /*PyObject *globals,*/
27062  0 /*PyObject *locals*/
27063  );
27064  if (!py_frame) goto bad;
27065  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27066  PyTraceBack_Here(py_frame);
27067 bad:
27068  Py_XDECREF(py_code);
27069  Py_XDECREF(py_frame);
27070 }
27071 
27072 #if PY_MAJOR_VERSION < 3
27073 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27074  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27075  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27076  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27077  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27078  return -1;
27079 }
27080 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27081  PyObject *obj = view->obj;
27082  if (!obj) return;
27083  if (PyObject_CheckBuffer(obj)) {
27084  PyBuffer_Release(view);
27085  return;
27086  }
27087  if ((0)) {}
27088  view->obj = NULL;
27089  Py_DECREF(obj);
27090 }
27091 #endif
27092 
27093 
27094 /* MemviewSliceIsContig */
27095 static int
27096 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27097 {
27098  int i, index, step, start;
27099  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27100  if (order == 'F') {
27101  step = 1;
27102  start = 0;
27103  } else {
27104  step = -1;
27105  start = ndim - 1;
27106  }
27107  for (i = 0; i < ndim; i++) {
27108  index = start + step * i;
27109  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27110  return 0;
27111  itemsize *= mvs.shape[index];
27112  }
27113  return 1;
27114 }
27115 
27116 /* OverlappingSlices */
27117 static void
27118 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27119  void **out_start, void **out_end,
27120  int ndim, size_t itemsize)
27121 {
27122  char *start, *end;
27123  int i;
27124  start = end = slice->data;
27125  for (i = 0; i < ndim; i++) {
27126  Py_ssize_t stride = slice->strides[i];
27127  Py_ssize_t extent = slice->shape[i];
27128  if (extent == 0) {
27129  *out_start = *out_end = start;
27130  return;
27131  } else {
27132  if (stride > 0)
27133  end += stride * (extent - 1);
27134  else
27135  start += stride * (extent - 1);
27136  }
27137  }
27138  *out_start = start;
27139  *out_end = end + itemsize;
27140 }
27141 static int
27142 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27143  __Pyx_memviewslice *slice2,
27144  int ndim, size_t itemsize)
27145 {
27146  void *start1, *end1, *start2, *end2;
27147  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27148  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27149  return (start1 < end2) && (start2 < end1);
27150 }
27151 
27152 /* Capsule */
27153 static CYTHON_INLINE PyObject *
27154 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27155 {
27156  PyObject *cobj;
27157 #if PY_VERSION_HEX >= 0x02070000
27158  cobj = PyCapsule_New(p, sig, NULL);
27159 #else
27160  cobj = PyCObject_FromVoidPtr(p, NULL);
27161 #endif
27162  return cobj;
27163 }
27164 
27165 /* CIntFromPyVerify */
27166 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27167  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27168 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27169  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27170 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27171  {\
27172  func_type value = func_value;\
27173  if (sizeof(target_type) < sizeof(func_type)) {\
27174  if (unlikely(value != (func_type) (target_type) value)) {\
27175  func_type zero = 0;\
27176  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27177  return (target_type) -1;\
27178  if (is_unsigned && unlikely(value < zero))\
27179  goto raise_neg_overflow;\
27180  else\
27181  goto raise_overflow;\
27182  }\
27183  }\
27184  return (target_type) value;\
27185  }
27186 
27187 /* IsLittleEndian */
27188 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27189 {
27190  union {
27191  uint32_t u32;
27192  uint8_t u8[4];
27193  } S;
27194  S.u32 = 0x01020304;
27195  return S.u8[0] == 4;
27196 }
27197 
27198 /* BufferFormatCheck */
27199 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27200  __Pyx_BufFmt_StackElem* stack,
27201  __Pyx_TypeInfo* type) {
27202  stack[0].field = &ctx->root;
27203  stack[0].parent_offset = 0;
27204  ctx->root.type = type;
27205  ctx->root.name = "buffer dtype";
27206  ctx->root.offset = 0;
27207  ctx->head = stack;
27208  ctx->head->field = &ctx->root;
27209  ctx->fmt_offset = 0;
27210  ctx->head->parent_offset = 0;
27211  ctx->new_packmode = '@';
27212  ctx->enc_packmode = '@';
27213  ctx->new_count = 1;
27214  ctx->enc_count = 0;
27215  ctx->enc_type = 0;
27216  ctx->is_complex = 0;
27217  ctx->is_valid_array = 0;
27218  ctx->struct_alignment = 0;
27219  while (type->typegroup == 'S') {
27220  ++ctx->head;
27221  ctx->head->field = type->fields;
27222  ctx->head->parent_offset = 0;
27223  type = type->fields->type;
27224  }
27225 }
27226 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27227  int count;
27228  const char* t = *ts;
27229  if (*t < '0' || *t > '9') {
27230  return -1;
27231  } else {
27232  count = *t++ - '0';
27233  while (*t >= '0' && *t <= '9') {
27234  count *= 10;
27235  count += *t++ - '0';
27236  }
27237  }
27238  *ts = t;
27239  return count;
27240 }
27241 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27242  int number = __Pyx_BufFmt_ParseNumber(ts);
27243  if (number == -1)
27244  PyErr_Format(PyExc_ValueError,\
27245  "Does not understand character buffer dtype format string ('%c')", **ts);
27246  return number;
27247 }
27248 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27249  PyErr_Format(PyExc_ValueError,
27250  "Unexpected format string character: '%c'", ch);
27251 }
27252 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27253  switch (ch) {
27254  case '?': return "'bool'";
27255  case 'c': return "'char'";
27256  case 'b': return "'signed char'";
27257  case 'B': return "'unsigned char'";
27258  case 'h': return "'short'";
27259  case 'H': return "'unsigned short'";
27260  case 'i': return "'int'";
27261  case 'I': return "'unsigned int'";
27262  case 'l': return "'long'";
27263  case 'L': return "'unsigned long'";
27264  case 'q': return "'long long'";
27265  case 'Q': return "'unsigned long long'";
27266  case 'f': return (is_complex ? "'complex float'" : "'float'");
27267  case 'd': return (is_complex ? "'complex double'" : "'double'");
27268  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27269  case 'T': return "a struct";
27270  case 'O': return "Python object";
27271  case 'P': return "a pointer";
27272  case 's': case 'p': return "a string";
27273  case 0: return "end";
27274  default: return "unparseable format string";
27275  }
27276 }
27277 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
27278  switch (ch) {
27279  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27280  case 'h': case 'H': return 2;
27281  case 'i': case 'I': case 'l': case 'L': return 4;
27282  case 'q': case 'Q': return 8;
27283  case 'f': return (is_complex ? 8 : 4);
27284  case 'd': return (is_complex ? 16 : 8);
27285  case 'g': {
27286  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
27287  return 0;
27288  }
27289  case 'O': case 'P': return sizeof(void*);
27290  default:
27291  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27292  return 0;
27293  }
27294 }
27295 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
27296  switch (ch) {
27297  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27298  case 'h': case 'H': return sizeof(short);
27299  case 'i': case 'I': return sizeof(int);
27300  case 'l': case 'L': return sizeof(long);
27301  #ifdef HAVE_LONG_LONG
27302  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
27303  #endif
27304  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
27305  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
27306  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
27307  case 'O': case 'P': return sizeof(void*);
27308  default: {
27309  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27310  return 0;
27311  }
27312  }
27313 }
27314 typedef struct { char c; short x; } __Pyx_st_short;
27315 typedef struct { char c; int x; } __Pyx_st_int;
27316 typedef struct { char c; long x; } __Pyx_st_long;
27317 typedef struct { char c; float x; } __Pyx_st_float;
27318 typedef struct { char c; double x; } __Pyx_st_double;
27319 typedef struct { char c; long double x; } __Pyx_st_longdouble;
27320 typedef struct { char c; void *x; } __Pyx_st_void_p;
27321 #ifdef HAVE_LONG_LONG
27322 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27323 #endif
27324 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
27325  switch (ch) {
27326  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27327  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
27328  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
27329  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
27330 #ifdef HAVE_LONG_LONG
27331  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
27332 #endif
27333  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
27334  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
27335  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
27336  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
27337  default:
27338  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27339  return 0;
27340  }
27341 }
27342 /* These are for computing the padding at the end of the struct to align
27343  on the first member of the struct. This will probably the same as above,
27344  but we don't have any guarantees.
27345  */
27346 typedef struct { short x; char c; } __Pyx_pad_short;
27347 typedef struct { int x; char c; } __Pyx_pad_int;
27348 typedef struct { long x; char c; } __Pyx_pad_long;
27349 typedef struct { float x; char c; } __Pyx_pad_float;
27350 typedef struct { double x; char c; } __Pyx_pad_double;
27351 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
27352 typedef struct { void *x; char c; } __Pyx_pad_void_p;
27353 #ifdef HAVE_LONG_LONG
27354 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
27355 #endif
27356 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
27357  switch (ch) {
27358  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27359  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
27360  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
27361  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
27362 #ifdef HAVE_LONG_LONG
27363  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
27364 #endif
27365  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
27366  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
27367  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
27368  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
27369  default:
27370  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27371  return 0;
27372  }
27373 }
27374 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
27375  switch (ch) {
27376  case 'c':
27377  return 'H';
27378  case 'b': case 'h': case 'i':
27379  case 'l': case 'q': case 's': case 'p':
27380  return 'I';
27381  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
27382  return 'U';
27383  case 'f': case 'd': case 'g':
27384  return (is_complex ? 'C' : 'R');
27385  case 'O':
27386  return 'O';
27387  case 'P':
27388  return 'P';
27389  default: {
27390  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27391  return 0;
27392  }
27393  }
27394 }
27395 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27396  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27397  const char* expected;
27398  const char* quote;
27399  if (ctx->head == NULL) {
27400  expected = "end";
27401  quote = "";
27402  } else {
27403  expected = ctx->head->field->type->name;
27404  quote = "'";
27405  }
27406  PyErr_Format(PyExc_ValueError,
27407  "Buffer dtype mismatch, expected %s%s%s but got %s",
27408  quote, expected, quote,
27409  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27410  } else {
27411  __Pyx_StructField* field = ctx->head->field;
27412  __Pyx_StructField* parent = (ctx->head - 1)->field;
27413  PyErr_Format(PyExc_ValueError,
27414  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27415  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27416  parent->type->name, field->name);
27417  }
27418 }
27419 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27420  char group;
27421  size_t size, offset, arraysize = 1;
27422  if (ctx->enc_type == 0) return 0;
27423  if (ctx->head->field->type->arraysize[0]) {
27424  int i, ndim = 0;
27425  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27426  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27427  ndim = 1;
27428  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27429  PyErr_Format(PyExc_ValueError,
27430  "Expected a dimension of size %zu, got %zu",
27431  ctx->head->field->type->arraysize[0], ctx->enc_count);
27432  return -1;
27433  }
27434  }
27435  if (!ctx->is_valid_array) {
27436  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27437  ctx->head->field->type->ndim, ndim);
27438  return -1;
27439  }
27440  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27441  arraysize *= ctx->head->field->type->arraysize[i];
27442  }
27443  ctx->is_valid_array = 0;
27444  ctx->enc_count = 1;
27445  }
27446  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27447  do {
27448  __Pyx_StructField* field = ctx->head->field;
27449  __Pyx_TypeInfo* type = field->type;
27450  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27451  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27452  } else {
27453  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27454  }
27455  if (ctx->enc_packmode == '@') {
27456  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27457  size_t align_mod_offset;
27458  if (align_at == 0) return -1;
27459  align_mod_offset = ctx->fmt_offset % align_at;
27460  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27461  if (ctx->struct_alignment == 0)
27462  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27463  ctx->is_complex);
27464  }
27465  if (type->size != size || type->typegroup != group) {
27466  if (type->typegroup == 'C' && type->fields != NULL) {
27467  size_t parent_offset = ctx->head->parent_offset + field->offset;
27468  ++ctx->head;
27469  ctx->head->field = type->fields;
27470  ctx->head->parent_offset = parent_offset;
27471  continue;
27472  }
27473  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27474  } else {
27475  __Pyx_BufFmt_RaiseExpected(ctx);
27476  return -1;
27477  }
27478  }
27479  offset = ctx->head->parent_offset + field->offset;
27480  if (ctx->fmt_offset != offset) {
27481  PyErr_Format(PyExc_ValueError,
27482  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27483  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27484  return -1;
27485  }
27486  ctx->fmt_offset += size;
27487  if (arraysize)
27488  ctx->fmt_offset += (arraysize - 1) * size;
27489  --ctx->enc_count;
27490  while (1) {
27491  if (field == &ctx->root) {
27492  ctx->head = NULL;
27493  if (ctx->enc_count != 0) {
27494  __Pyx_BufFmt_RaiseExpected(ctx);
27495  return -1;
27496  }
27497  break;
27498  }
27499  ctx->head->field = ++field;
27500  if (field->type == NULL) {
27501  --ctx->head;
27502  field = ctx->head->field;
27503  continue;
27504  } else if (field->type->typegroup == 'S') {
27505  size_t parent_offset = ctx->head->parent_offset + field->offset;
27506  if (field->type->fields->type == NULL) continue;
27507  field = field->type->fields;
27508  ++ctx->head;
27509  ctx->head->field = field;
27510  ctx->head->parent_offset = parent_offset;
27511  break;
27512  } else {
27513  break;
27514  }
27515  }
27516  } while (ctx->enc_count);
27517  ctx->enc_type = 0;
27518  ctx->is_complex = 0;
27519  return 0;
27520 }
27521 static PyObject *
27522 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27523 {
27524  const char *ts = *tsp;
27525  int i = 0, number, ndim;
27526  ++ts;
27527  if (ctx->new_count != 1) {
27528  PyErr_SetString(PyExc_ValueError,
27529  "Cannot handle repeated arrays in format string");
27530  return NULL;
27531  }
27532  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27533  ndim = ctx->head->field->type->ndim;
27534  while (*ts && *ts != ')') {
27535  switch (*ts) {
27536  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27537  default: break;
27538  }
27539  number = __Pyx_BufFmt_ExpectNumber(&ts);
27540  if (number == -1) return NULL;
27541  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27542  return PyErr_Format(PyExc_ValueError,
27543  "Expected a dimension of size %zu, got %d",
27544  ctx->head->field->type->arraysize[i], number);
27545  if (*ts != ',' && *ts != ')')
27546  return PyErr_Format(PyExc_ValueError,
27547  "Expected a comma in format string, got '%c'", *ts);
27548  if (*ts == ',') ts++;
27549  i++;
27550  }
27551  if (i != ndim)
27552  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27553  ctx->head->field->type->ndim, i);
27554  if (!*ts) {
27555  PyErr_SetString(PyExc_ValueError,
27556  "Unexpected end of format string, expected ')'");
27557  return NULL;
27558  }
27559  ctx->is_valid_array = 1;
27560  ctx->new_count = 1;
27561  *tsp = ++ts;
27562  return Py_None;
27563 }
27564 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27565  int got_Z = 0;
27566  while (1) {
27567  switch(*ts) {
27568  case 0:
27569  if (ctx->enc_type != 0 && ctx->head == NULL) {
27570  __Pyx_BufFmt_RaiseExpected(ctx);
27571  return NULL;
27572  }
27573  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27574  if (ctx->head != NULL) {
27575  __Pyx_BufFmt_RaiseExpected(ctx);
27576  return NULL;
27577  }
27578  return ts;
27579  case ' ':
27580  case '\r':
27581  case '\n':
27582  ++ts;
27583  break;
27584  case '<':
27585  if (!__Pyx_Is_Little_Endian()) {
27586  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27587  return NULL;
27588  }
27589  ctx->new_packmode = '=';
27590  ++ts;
27591  break;
27592  case '>':
27593  case '!':
27594  if (__Pyx_Is_Little_Endian()) {
27595  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27596  return NULL;
27597  }
27598  ctx->new_packmode = '=';
27599  ++ts;
27600  break;
27601  case '=':
27602  case '@':
27603  case '^':
27604  ctx->new_packmode = *ts++;
27605  break;
27606  case 'T':
27607  {
27608  const char* ts_after_sub;
27609  size_t i, struct_count = ctx->new_count;
27610  size_t struct_alignment = ctx->struct_alignment;
27611  ctx->new_count = 1;
27612  ++ts;
27613  if (*ts != '{') {
27614  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27615  return NULL;
27616  }
27617  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27618  ctx->enc_type = 0;
27619  ctx->enc_count = 0;
27620  ctx->struct_alignment = 0;
27621  ++ts;
27622  ts_after_sub = ts;
27623  for (i = 0; i != struct_count; ++i) {
27624  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27625  if (!ts_after_sub) return NULL;
27626  }
27627  ts = ts_after_sub;
27628  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27629  }
27630  break;
27631  case '}':
27632  {
27633  size_t alignment = ctx->struct_alignment;
27634  ++ts;
27635  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27636  ctx->enc_type = 0;
27637  if (alignment && ctx->fmt_offset % alignment) {
27638  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27639  }
27640  }
27641  return ts;
27642  case 'x':
27643  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27644  ctx->fmt_offset += ctx->new_count;
27645  ctx->new_count = 1;
27646  ctx->enc_count = 0;
27647  ctx->enc_type = 0;
27648  ctx->enc_packmode = ctx->new_packmode;
27649  ++ts;
27650  break;
27651  case 'Z':
27652  got_Z = 1;
27653  ++ts;
27654  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27655  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27656  return NULL;
27657  }
27658  CYTHON_FALLTHROUGH;
27659  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27660  case 'l': case 'L': case 'q': case 'Q':
27661  case 'f': case 'd': case 'g':
27662  case 'O': case 'p':
27663  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27664  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27665  ctx->enc_count += ctx->new_count;
27666  ctx->new_count = 1;
27667  got_Z = 0;
27668  ++ts;
27669  break;
27670  }
27671  CYTHON_FALLTHROUGH;
27672  case 's':
27673  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27674  ctx->enc_count = ctx->new_count;
27675  ctx->enc_packmode = ctx->new_packmode;
27676  ctx->enc_type = *ts;
27677  ctx->is_complex = got_Z;
27678  ++ts;
27679  ctx->new_count = 1;
27680  got_Z = 0;
27681  break;
27682  case ':':
27683  ++ts;
27684  while(*ts != ':') ++ts;
27685  ++ts;
27686  break;
27687  case '(':
27688  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27689  break;
27690  default:
27691  {
27692  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27693  if (number == -1) return NULL;
27694  ctx->new_count = (size_t)number;
27695  }
27696  }
27697  }
27698 }
27699 
27700 /* TypeInfoCompare */
27701  static int
27702 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27703 {
27704  int i;
27705  if (!a || !b)
27706  return 0;
27707  if (a == b)
27708  return 1;
27709  if (a->size != b->size || a->typegroup != b->typegroup ||
27710  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27711  if (a->typegroup == 'H' || b->typegroup == 'H') {
27712  return a->size == b->size;
27713  } else {
27714  return 0;
27715  }
27716  }
27717  if (a->ndim) {
27718  for (i = 0; i < a->ndim; i++)
27719  if (a->arraysize[i] != b->arraysize[i])
27720  return 0;
27721  }
27722  if (a->typegroup == 'S') {
27723  if (a->flags != b->flags)
27724  return 0;
27725  if (a->fields || b->fields) {
27726  if (!(a->fields && b->fields))
27727  return 0;
27728  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27729  __Pyx_StructField *field_a = a->fields + i;
27730  __Pyx_StructField *field_b = b->fields + i;
27731  if (field_a->offset != field_b->offset ||
27732  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27733  return 0;
27734  }
27735  return !a->fields[i].type && !b->fields[i].type;
27736  }
27737  }
27738  return 1;
27739 }
27740 
27741 /* MemviewSliceValidateAndInit */
27742  static int
27743 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27744 {
27745  if (buf->shape[dim] <= 1)
27746  return 1;
27747  if (buf->strides) {
27748  if (spec & __Pyx_MEMVIEW_CONTIG) {
27749  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27750  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27751  PyErr_Format(PyExc_ValueError,
27752  "Buffer is not indirectly contiguous "
27753  "in dimension %d.", dim);
27754  goto fail;
27755  }
27756  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27757  PyErr_SetString(PyExc_ValueError,
27758  "Buffer and memoryview are not contiguous "
27759  "in the same dimension.");
27760  goto fail;
27761  }
27762  }
27763  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27764  Py_ssize_t stride = buf->strides[dim];
27765  if (stride < 0)
27766  stride = -stride;
27767  if (unlikely(stride < buf->itemsize)) {
27768  PyErr_SetString(PyExc_ValueError,
27769  "Buffer and memoryview are not contiguous "
27770  "in the same dimension.");
27771  goto fail;
27772  }
27773  }
27774  } else {
27775  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27776  PyErr_Format(PyExc_ValueError,
27777  "C-contiguous buffer is not contiguous in "
27778  "dimension %d", dim);
27779  goto fail;
27780  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27781  PyErr_Format(PyExc_ValueError,
27782  "C-contiguous buffer is not indirect in "
27783  "dimension %d", dim);
27784  goto fail;
27785  } else if (unlikely(buf->suboffsets)) {
27786  PyErr_SetString(PyExc_ValueError,
27787  "Buffer exposes suboffsets but no strides");
27788  goto fail;
27789  }
27790  }
27791  return 1;
27792 fail:
27793  return 0;
27794 }
27795 static int
27796 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27797 {
27798  if (spec & __Pyx_MEMVIEW_DIRECT) {
27799  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27800  PyErr_Format(PyExc_ValueError,
27801  "Buffer not compatible with direct access "
27802  "in dimension %d.", dim);
27803  goto fail;
27804  }
27805  }
27806  if (spec & __Pyx_MEMVIEW_PTR) {
27807  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27808  PyErr_Format(PyExc_ValueError,
27809  "Buffer is not indirectly accessible "
27810  "in dimension %d.", dim);
27811  goto fail;
27812  }
27813  }
27814  return 1;
27815 fail:
27816  return 0;
27817 }
27818 static int
27819 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27820 {
27821  int i;
27822  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27823  Py_ssize_t stride = 1;
27824  for (i = 0; i < ndim; i++) {
27825  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27826  PyErr_SetString(PyExc_ValueError,
27827  "Buffer not fortran contiguous.");
27828  goto fail;
27829  }
27830  stride = stride * buf->shape[i];
27831  }
27832  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27833  Py_ssize_t stride = 1;
27834  for (i = ndim - 1; i >- 1; i--) {
27835  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27836  PyErr_SetString(PyExc_ValueError,
27837  "Buffer not C contiguous.");
27838  goto fail;
27839  }
27840  stride = stride * buf->shape[i];
27841  }
27842  }
27843  return 1;
27844 fail:
27845  return 0;
27846 }
27847 static int __Pyx_ValidateAndInit_memviewslice(
27848  int *axes_specs,
27849  int c_or_f_flag,
27850  int buf_flags,
27851  int ndim,
27852  __Pyx_TypeInfo *dtype,
27853  __Pyx_BufFmt_StackElem stack[],
27854  __Pyx_memviewslice *memviewslice,
27855  PyObject *original_obj)
27856 {
27857  struct __pyx_memoryview_obj *memview, *new_memview;
27858  __Pyx_RefNannyDeclarations
27859  Py_buffer *buf;
27860  int i, spec = 0, retval = -1;
27861  __Pyx_BufFmt_Context ctx;
27862  int from_memoryview = __pyx_memoryview_check(original_obj);
27863  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27864  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27865  original_obj)->typeinfo)) {
27866  memview = (struct __pyx_memoryview_obj *) original_obj;
27867  new_memview = NULL;
27868  } else {
27869  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27870  original_obj, buf_flags, 0, dtype);
27871  new_memview = memview;
27872  if (unlikely(!memview))
27873  goto fail;
27874  }
27875  buf = &memview->view;
27876  if (unlikely(buf->ndim != ndim)) {
27877  PyErr_Format(PyExc_ValueError,
27878  "Buffer has wrong number of dimensions (expected %d, got %d)",
27879  ndim, buf->ndim);
27880  goto fail;
27881  }
27882  if (new_memview) {
27883  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27884  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27885  }
27886  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27887  PyErr_Format(PyExc_ValueError,
27888  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27889  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27890  buf->itemsize,
27891  (buf->itemsize > 1) ? "s" : "",
27892  dtype->name,
27893  dtype->size,
27894  (dtype->size > 1) ? "s" : "");
27895  goto fail;
27896  }
27897  if (buf->len > 0) {
27898  for (i = 0; i < ndim; i++) {
27899  spec = axes_specs[i];
27900  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27901  goto fail;
27902  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27903  goto fail;
27904  }
27905  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27906  goto fail;
27907  }
27908  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27909  new_memview != NULL) == -1)) {
27910  goto fail;
27911  }
27912  retval = 0;
27913  goto no_fail;
27914 fail:
27915  Py_XDECREF(new_memview);
27916  retval = -1;
27917 no_fail:
27918  __Pyx_RefNannyFinishContext();
27919  return retval;
27920 }
27921 
27922 /* ObjectToMemviewSlice */
27923  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
27924  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27925  __Pyx_BufFmt_StackElem stack[1];
27926  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27927  int retcode;
27928  if (obj == Py_None) {
27929  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27930  return result;
27931  }
27932  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27933  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27934  &__Pyx_TypeInfo_float, stack,
27935  &result, obj);
27936  if (unlikely(retcode == -1))
27937  goto __pyx_fail;
27938  return result;
27939 __pyx_fail:
27940  result.memview = NULL;
27941  result.data = NULL;
27942  return result;
27943 }
27944 
27945 /* ObjectToMemviewSlice */
27946  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
27947  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27948  __Pyx_BufFmt_StackElem stack[1];
27949  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27950  int retcode;
27951  if (obj == Py_None) {
27952  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27953  return result;
27954  }
27955  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27956  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27957  &__Pyx_TypeInfo_float, stack,
27958  &result, obj);
27959  if (unlikely(retcode == -1))
27960  goto __pyx_fail;
27961  return result;
27962 __pyx_fail:
27963  result.memview = NULL;
27964  result.data = NULL;
27965  return result;
27966 }
27967 
27968 /* ObjectToMemviewSlice */
27969  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
27970  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27971  __Pyx_BufFmt_StackElem stack[1];
27972  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27973  int retcode;
27974  if (obj == Py_None) {
27975  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27976  return result;
27977  }
27978  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27979  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27980  &__Pyx_TypeInfo_double, stack,
27981  &result, obj);
27982  if (unlikely(retcode == -1))
27983  goto __pyx_fail;
27984  return result;
27985 __pyx_fail:
27986  result.memview = NULL;
27987  result.data = NULL;
27988  return result;
27989 }
27990 
27991 /* ObjectToMemviewSlice */
27992  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
27993  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27994  __Pyx_BufFmt_StackElem stack[1];
27995  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27996  int retcode;
27997  if (obj == Py_None) {
27998  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27999  return result;
28000  }
28001  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
28002  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28003  &__Pyx_TypeInfo_double, stack,
28004  &result, obj);
28005  if (unlikely(retcode == -1))
28006  goto __pyx_fail;
28007  return result;
28008 __pyx_fail:
28009  result.memview = NULL;
28010  result.data = NULL;
28011  return result;
28012 }
28013 
28014 /* ObjectToMemviewSlice */
28015  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
28016  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28017  __Pyx_BufFmt_StackElem stack[1];
28018  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
28019  int retcode;
28020  if (obj == Py_None) {
28021  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28022  return result;
28023  }
28024  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
28025  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28026  &__Pyx_TypeInfo_long__double, stack,
28027  &result, obj);
28028  if (unlikely(retcode == -1))
28029  goto __pyx_fail;
28030  return result;
28031 __pyx_fail:
28032  result.memview = NULL;
28033  result.data = NULL;
28034  return result;
28035 }
28036 
28037 /* ObjectToMemviewSlice */
28038  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj, int writable_flag) {
28039  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28040  __Pyx_BufFmt_StackElem stack[1];
28041  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
28042  int retcode;
28043  if (obj == Py_None) {
28044  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28045  return result;
28046  }
28047  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
28048  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28049  &__Pyx_TypeInfo_long__double, stack,
28050  &result, obj);
28051  if (unlikely(retcode == -1))
28052  goto __pyx_fail;
28053  return result;
28054 __pyx_fail:
28055  result.memview = NULL;
28056  result.data = NULL;
28057  return result;
28058 }
28059 
28060 /* ObjectToMemviewSlice */
28061  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
28062  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28063  __Pyx_BufFmt_StackElem stack[1];
28064  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28065  int retcode;
28066  if (obj == Py_None) {
28067  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28068  return result;
28069  }
28070  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28071  PyBUF_RECORDS_RO | writable_flag, 1,
28072  &__Pyx_TypeInfo_int, stack,
28073  &result, obj);
28074  if (unlikely(retcode == -1))
28075  goto __pyx_fail;
28076  return result;
28077 __pyx_fail:
28078  result.memview = NULL;
28079  result.data = NULL;
28080  return result;
28081 }
28082 
28083 /* ObjectToMemviewSlice */
28084  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
28085  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28086  __Pyx_BufFmt_StackElem stack[1];
28087  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28088  int retcode;
28089  if (obj == Py_None) {
28090  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28091  return result;
28092  }
28093  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28094  PyBUF_RECORDS_RO | writable_flag, 1,
28095  &__Pyx_TypeInfo_float, stack,
28096  &result, obj);
28097  if (unlikely(retcode == -1))
28098  goto __pyx_fail;
28099  return result;
28100 __pyx_fail:
28101  result.memview = NULL;
28102  result.data = NULL;
28103  return result;
28104 }
28105 
28106 /* ObjectToMemviewSlice */
28107  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28108  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28109  __Pyx_BufFmt_StackElem stack[1];
28110  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28111  int retcode;
28112  if (obj == Py_None) {
28113  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28114  return result;
28115  }
28116  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28117  PyBUF_RECORDS_RO | writable_flag, 1,
28118  &__Pyx_TypeInfo_double, stack,
28119  &result, obj);
28120  if (unlikely(retcode == -1))
28121  goto __pyx_fail;
28122  return result;
28123 __pyx_fail:
28124  result.memview = NULL;
28125  result.data = NULL;
28126  return result;
28127 }
28128 
28129 /* ObjectToMemviewSlice */
28130  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
28131  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28132  __Pyx_BufFmt_StackElem stack[1];
28133  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28134  int retcode;
28135  if (obj == Py_None) {
28136  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28137  return result;
28138  }
28139  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28140  PyBUF_RECORDS_RO | writable_flag, 1,
28141  &__Pyx_TypeInfo_long__double, stack,
28142  &result, obj);
28143  if (unlikely(retcode == -1))
28144  goto __pyx_fail;
28145  return result;
28146 __pyx_fail:
28147  result.memview = NULL;
28148  result.data = NULL;
28149  return result;
28150 }
28151 
28152 /* MemviewSliceCopyTemplate */
28153  static __Pyx_memviewslice
28154 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28155  const char *mode, int ndim,
28156  size_t sizeof_dtype, int contig_flag,
28157  int dtype_is_object)
28158 {
28159  __Pyx_RefNannyDeclarations
28160  int i;
28161  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28162  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28163  Py_buffer *buf = &from_memview->view;
28164  PyObject *shape_tuple = NULL;
28165  PyObject *temp_int = NULL;
28166  struct __pyx_array_obj *array_obj = NULL;
28167  struct __pyx_memoryview_obj *memview_obj = NULL;
28168  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28169  for (i = 0; i < ndim; i++) {
28170  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28171  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28172  "indirect dimensions (axis %d)", i);
28173  goto fail;
28174  }
28175  }
28176  shape_tuple = PyTuple_New(ndim);
28177  if (unlikely(!shape_tuple)) {
28178  goto fail;
28179  }
28180  __Pyx_GOTREF(shape_tuple);
28181  for(i = 0; i < ndim; i++) {
28182  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28183  if(unlikely(!temp_int)) {
28184  goto fail;
28185  } else {
28186  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28187  temp_int = NULL;
28188  }
28189  }
28190  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28191  if (unlikely(!array_obj)) {
28192  goto fail;
28193  }
28194  __Pyx_GOTREF(array_obj);
28195  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28196  (PyObject *) array_obj, contig_flag,
28197  dtype_is_object,
28198  from_mvs->memview->typeinfo);
28199  if (unlikely(!memview_obj))
28200  goto fail;
28201  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28202  goto fail;
28203  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28204  dtype_is_object) < 0))
28205  goto fail;
28206  goto no_fail;
28207 fail:
28208  __Pyx_XDECREF(new_mvs.memview);
28209  new_mvs.memview = NULL;
28210  new_mvs.data = NULL;
28211 no_fail:
28212  __Pyx_XDECREF(shape_tuple);
28213  __Pyx_XDECREF(temp_int);
28214  __Pyx_XDECREF(array_obj);
28215  __Pyx_RefNannyFinishContext();
28216  return new_mvs;
28217 }
28218 
28219 /* CIntToPy */
28220  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28221 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28222 #pragma GCC diagnostic push
28223 #pragma GCC diagnostic ignored "-Wconversion"
28224 #endif
28225  const long neg_one = (long) -1, const_zero = (long) 0;
28226 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28227 #pragma GCC diagnostic pop
28228 #endif
28229  const int is_unsigned = neg_one > const_zero;
28230  if (is_unsigned) {
28231  if (sizeof(long) < sizeof(long)) {
28232  return PyInt_FromLong((long) value);
28233  } else if (sizeof(long) <= sizeof(unsigned long)) {
28234  return PyLong_FromUnsignedLong((unsigned long) value);
28235 #ifdef HAVE_LONG_LONG
28236  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28237  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28238 #endif
28239  }
28240  } else {
28241  if (sizeof(long) <= sizeof(long)) {
28242  return PyInt_FromLong((long) value);
28243 #ifdef HAVE_LONG_LONG
28244  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28245  return PyLong_FromLongLong((PY_LONG_LONG) value);
28246 #endif
28247  }
28248  }
28249  {
28250  int one = 1; int little = (int)*(unsigned char *)&one;
28251  unsigned char *bytes = (unsigned char *)&value;
28252  return _PyLong_FromByteArray(bytes, sizeof(long),
28253  little, !is_unsigned);
28254  }
28255 }
28256 
28257 /* CIntFromPy */
28258  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28259 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28260 #pragma GCC diagnostic push
28261 #pragma GCC diagnostic ignored "-Wconversion"
28262 #endif
28263  const int neg_one = (int) -1, const_zero = (int) 0;
28264 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28265 #pragma GCC diagnostic pop
28266 #endif
28267  const int is_unsigned = neg_one > const_zero;
28268 #if PY_MAJOR_VERSION < 3
28269  if (likely(PyInt_Check(x))) {
28270  if (sizeof(int) < sizeof(long)) {
28271  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28272  } else {
28273  long val = PyInt_AS_LONG(x);
28274  if (is_unsigned && unlikely(val < 0)) {
28275  goto raise_neg_overflow;
28276  }
28277  return (int) val;
28278  }
28279  } else
28280 #endif
28281  if (likely(PyLong_Check(x))) {
28282  if (is_unsigned) {
28283 #if CYTHON_USE_PYLONG_INTERNALS
28284  const digit* digits = ((PyLongObject*)x)->ob_digit;
28285  switch (Py_SIZE(x)) {
28286  case 0: return (int) 0;
28287  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28288  case 2:
28289  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28290  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28291  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28292  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28293  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28294  }
28295  }
28296  break;
28297  case 3:
28298  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28299  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28300  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28301  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28302  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28303  }
28304  }
28305  break;
28306  case 4:
28307  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28308  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28309  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28310  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28311  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28312  }
28313  }
28314  break;
28315  }
28316 #endif
28317 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28318  if (unlikely(Py_SIZE(x) < 0)) {
28319  goto raise_neg_overflow;
28320  }
28321 #else
28322  {
28323  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28324  if (unlikely(result < 0))
28325  return (int) -1;
28326  if (unlikely(result == 1))
28327  goto raise_neg_overflow;
28328  }
28329 #endif
28330  if (sizeof(int) <= sizeof(unsigned long)) {
28331  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28332 #ifdef HAVE_LONG_LONG
28333  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28334  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28335 #endif
28336  }
28337  } else {
28338 #if CYTHON_USE_PYLONG_INTERNALS
28339  const digit* digits = ((PyLongObject*)x)->ob_digit;
28340  switch (Py_SIZE(x)) {
28341  case 0: return (int) 0;
28342  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28343  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28344  case -2:
28345  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28346  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28347  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28348  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28349  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28350  }
28351  }
28352  break;
28353  case 2:
28354  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28355  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28356  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28357  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28358  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28359  }
28360  }
28361  break;
28362  case -3:
28363  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28364  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28365  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28366  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28367  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28368  }
28369  }
28370  break;
28371  case 3:
28372  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28373  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28374  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28375  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28376  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28377  }
28378  }
28379  break;
28380  case -4:
28381  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28382  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28383  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28384  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28385  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28386  }
28387  }
28388  break;
28389  case 4:
28390  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28391  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28392  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28393  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28394  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28395  }
28396  }
28397  break;
28398  }
28399 #endif
28400  if (sizeof(int) <= sizeof(long)) {
28401  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28402 #ifdef HAVE_LONG_LONG
28403  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28404  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28405 #endif
28406  }
28407  }
28408  {
28409 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28410  PyErr_SetString(PyExc_RuntimeError,
28411  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28412 #else
28413  int val;
28414  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28415  #if PY_MAJOR_VERSION < 3
28416  if (likely(v) && !PyLong_Check(v)) {
28417  PyObject *tmp = v;
28418  v = PyNumber_Long(tmp);
28419  Py_DECREF(tmp);
28420  }
28421  #endif
28422  if (likely(v)) {
28423  int one = 1; int is_little = (int)*(unsigned char *)&one;
28424  unsigned char *bytes = (unsigned char *)&val;
28425  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28426  bytes, sizeof(val),
28427  is_little, !is_unsigned);
28428  Py_DECREF(v);
28429  if (likely(!ret))
28430  return val;
28431  }
28432 #endif
28433  return (int) -1;
28434  }
28435  } else {
28436  int val;
28437  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28438  if (!tmp) return (int) -1;
28439  val = __Pyx_PyInt_As_int(tmp);
28440  Py_DECREF(tmp);
28441  return val;
28442  }
28443 raise_overflow:
28444  PyErr_SetString(PyExc_OverflowError,
28445  "value too large to convert to int");
28446  return (int) -1;
28447 raise_neg_overflow:
28448  PyErr_SetString(PyExc_OverflowError,
28449  "can't convert negative value to int");
28450  return (int) -1;
28451 }
28452 
28453 /* CIntFromPy */
28454  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28455 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28456 #pragma GCC diagnostic push
28457 #pragma GCC diagnostic ignored "-Wconversion"
28458 #endif
28459  const long neg_one = (long) -1, const_zero = (long) 0;
28460 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28461 #pragma GCC diagnostic pop
28462 #endif
28463  const int is_unsigned = neg_one > const_zero;
28464 #if PY_MAJOR_VERSION < 3
28465  if (likely(PyInt_Check(x))) {
28466  if (sizeof(long) < sizeof(long)) {
28467  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28468  } else {
28469  long val = PyInt_AS_LONG(x);
28470  if (is_unsigned && unlikely(val < 0)) {
28471  goto raise_neg_overflow;
28472  }
28473  return (long) val;
28474  }
28475  } else
28476 #endif
28477  if (likely(PyLong_Check(x))) {
28478  if (is_unsigned) {
28479 #if CYTHON_USE_PYLONG_INTERNALS
28480  const digit* digits = ((PyLongObject*)x)->ob_digit;
28481  switch (Py_SIZE(x)) {
28482  case 0: return (long) 0;
28483  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28484  case 2:
28485  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28486  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28487  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28488  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28489  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28490  }
28491  }
28492  break;
28493  case 3:
28494  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28495  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28496  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28497  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28498  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28499  }
28500  }
28501  break;
28502  case 4:
28503  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28504  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28505  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28506  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28507  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28508  }
28509  }
28510  break;
28511  }
28512 #endif
28513 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28514  if (unlikely(Py_SIZE(x) < 0)) {
28515  goto raise_neg_overflow;
28516  }
28517 #else
28518  {
28519  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28520  if (unlikely(result < 0))
28521  return (long) -1;
28522  if (unlikely(result == 1))
28523  goto raise_neg_overflow;
28524  }
28525 #endif
28526  if (sizeof(long) <= sizeof(unsigned long)) {
28527  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28528 #ifdef HAVE_LONG_LONG
28529  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28530  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28531 #endif
28532  }
28533  } else {
28534 #if CYTHON_USE_PYLONG_INTERNALS
28535  const digit* digits = ((PyLongObject*)x)->ob_digit;
28536  switch (Py_SIZE(x)) {
28537  case 0: return (long) 0;
28538  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28539  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28540  case -2:
28541  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28542  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28543  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28544  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28545  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28546  }
28547  }
28548  break;
28549  case 2:
28550  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28551  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28552  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28553  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28554  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28555  }
28556  }
28557  break;
28558  case -3:
28559  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28560  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28561  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28562  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28563  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28564  }
28565  }
28566  break;
28567  case 3:
28568  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28569  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28570  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28571  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28572  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28573  }
28574  }
28575  break;
28576  case -4:
28577  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28578  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28579  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28580  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28581  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28582  }
28583  }
28584  break;
28585  case 4:
28586  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28587  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28588  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28589  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28590  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28591  }
28592  }
28593  break;
28594  }
28595 #endif
28596  if (sizeof(long) <= sizeof(long)) {
28597  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28598 #ifdef HAVE_LONG_LONG
28599  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28600  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28601 #endif
28602  }
28603  }
28604  {
28605 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28606  PyErr_SetString(PyExc_RuntimeError,
28607  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28608 #else
28609  long val;
28610  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28611  #if PY_MAJOR_VERSION < 3
28612  if (likely(v) && !PyLong_Check(v)) {
28613  PyObject *tmp = v;
28614  v = PyNumber_Long(tmp);
28615  Py_DECREF(tmp);
28616  }
28617  #endif
28618  if (likely(v)) {
28619  int one = 1; int is_little = (int)*(unsigned char *)&one;
28620  unsigned char *bytes = (unsigned char *)&val;
28621  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28622  bytes, sizeof(val),
28623  is_little, !is_unsigned);
28624  Py_DECREF(v);
28625  if (likely(!ret))
28626  return val;
28627  }
28628 #endif
28629  return (long) -1;
28630  }
28631  } else {
28632  long val;
28633  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28634  if (!tmp) return (long) -1;
28635  val = __Pyx_PyInt_As_long(tmp);
28636  Py_DECREF(tmp);
28637  return val;
28638  }
28639 raise_overflow:
28640  PyErr_SetString(PyExc_OverflowError,
28641  "value too large to convert to long");
28642  return (long) -1;
28643 raise_neg_overflow:
28644  PyErr_SetString(PyExc_OverflowError,
28645  "can't convert negative value to long");
28646  return (long) -1;
28647 }
28648 
28649 /* CIntToPy */
28650  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28651 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28652 #pragma GCC diagnostic push
28653 #pragma GCC diagnostic ignored "-Wconversion"
28654 #endif
28655  const int neg_one = (int) -1, const_zero = (int) 0;
28656 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28657 #pragma GCC diagnostic pop
28658 #endif
28659  const int is_unsigned = neg_one > const_zero;
28660  if (is_unsigned) {
28661  if (sizeof(int) < sizeof(long)) {
28662  return PyInt_FromLong((long) value);
28663  } else if (sizeof(int) <= sizeof(unsigned long)) {
28664  return PyLong_FromUnsignedLong((unsigned long) value);
28665 #ifdef HAVE_LONG_LONG
28666  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28667  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28668 #endif
28669  }
28670  } else {
28671  if (sizeof(int) <= sizeof(long)) {
28672  return PyInt_FromLong((long) value);
28673 #ifdef HAVE_LONG_LONG
28674  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28675  return PyLong_FromLongLong((PY_LONG_LONG) value);
28676 #endif
28677  }
28678  }
28679  {
28680  int one = 1; int little = (int)*(unsigned char *)&one;
28681  unsigned char *bytes = (unsigned char *)&value;
28682  return _PyLong_FromByteArray(bytes, sizeof(int),
28683  little, !is_unsigned);
28684  }
28685 }
28686 
28687 /* CIntFromPy */
28688  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28689 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28690 #pragma GCC diagnostic push
28691 #pragma GCC diagnostic ignored "-Wconversion"
28692 #endif
28693  const char neg_one = (char) -1, const_zero = (char) 0;
28694 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28695 #pragma GCC diagnostic pop
28696 #endif
28697  const int is_unsigned = neg_one > const_zero;
28698 #if PY_MAJOR_VERSION < 3
28699  if (likely(PyInt_Check(x))) {
28700  if (sizeof(char) < sizeof(long)) {
28701  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28702  } else {
28703  long val = PyInt_AS_LONG(x);
28704  if (is_unsigned && unlikely(val < 0)) {
28705  goto raise_neg_overflow;
28706  }
28707  return (char) val;
28708  }
28709  } else
28710 #endif
28711  if (likely(PyLong_Check(x))) {
28712  if (is_unsigned) {
28713 #if CYTHON_USE_PYLONG_INTERNALS
28714  const digit* digits = ((PyLongObject*)x)->ob_digit;
28715  switch (Py_SIZE(x)) {
28716  case 0: return (char) 0;
28717  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28718  case 2:
28719  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28720  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28721  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28722  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28723  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28724  }
28725  }
28726  break;
28727  case 3:
28728  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28729  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28730  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28731  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28732  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28733  }
28734  }
28735  break;
28736  case 4:
28737  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28738  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28739  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28740  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28741  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28742  }
28743  }
28744  break;
28745  }
28746 #endif
28747 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28748  if (unlikely(Py_SIZE(x) < 0)) {
28749  goto raise_neg_overflow;
28750  }
28751 #else
28752  {
28753  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28754  if (unlikely(result < 0))
28755  return (char) -1;
28756  if (unlikely(result == 1))
28757  goto raise_neg_overflow;
28758  }
28759 #endif
28760  if (sizeof(char) <= sizeof(unsigned long)) {
28761  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28762 #ifdef HAVE_LONG_LONG
28763  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28764  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28765 #endif
28766  }
28767  } else {
28768 #if CYTHON_USE_PYLONG_INTERNALS
28769  const digit* digits = ((PyLongObject*)x)->ob_digit;
28770  switch (Py_SIZE(x)) {
28771  case 0: return (char) 0;
28772  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28773  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28774  case -2:
28775  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28776  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28777  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28778  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28779  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28780  }
28781  }
28782  break;
28783  case 2:
28784  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28785  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28786  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28787  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28788  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28789  }
28790  }
28791  break;
28792  case -3:
28793  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28794  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28795  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28796  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28797  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28798  }
28799  }
28800  break;
28801  case 3:
28802  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28803  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28804  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28805  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28806  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28807  }
28808  }
28809  break;
28810  case -4:
28811  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28812  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28813  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28814  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28815  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28816  }
28817  }
28818  break;
28819  case 4:
28820  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28821  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28822  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28823  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28824  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28825  }
28826  }
28827  break;
28828  }
28829 #endif
28830  if (sizeof(char) <= sizeof(long)) {
28831  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28832 #ifdef HAVE_LONG_LONG
28833  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28834  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28835 #endif
28836  }
28837  }
28838  {
28839 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28840  PyErr_SetString(PyExc_RuntimeError,
28841  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28842 #else
28843  char val;
28844  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28845  #if PY_MAJOR_VERSION < 3
28846  if (likely(v) && !PyLong_Check(v)) {
28847  PyObject *tmp = v;
28848  v = PyNumber_Long(tmp);
28849  Py_DECREF(tmp);
28850  }
28851  #endif
28852  if (likely(v)) {
28853  int one = 1; int is_little = (int)*(unsigned char *)&one;
28854  unsigned char *bytes = (unsigned char *)&val;
28855  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28856  bytes, sizeof(val),
28857  is_little, !is_unsigned);
28858  Py_DECREF(v);
28859  if (likely(!ret))
28860  return val;
28861  }
28862 #endif
28863  return (char) -1;
28864  }
28865  } else {
28866  char val;
28867  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28868  if (!tmp) return (char) -1;
28869  val = __Pyx_PyInt_As_char(tmp);
28870  Py_DECREF(tmp);
28871  return val;
28872  }
28873 raise_overflow:
28874  PyErr_SetString(PyExc_OverflowError,
28875  "value too large to convert to char");
28876  return (char) -1;
28877 raise_neg_overflow:
28878  PyErr_SetString(PyExc_OverflowError,
28879  "can't convert negative value to char");
28880  return (char) -1;
28881 }
28882 
28883 /* CheckBinaryVersion */
28884  static int __Pyx_check_binary_version(void) {
28885  char ctversion[5];
28886  int same=1, i, found_dot;
28887  const char* rt_from_call = Py_GetVersion();
28888  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28889  found_dot = 0;
28890  for (i = 0; i < 4; i++) {
28891  if (!ctversion[i]) {
28892  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
28893  break;
28894  }
28895  if (rt_from_call[i] != ctversion[i]) {
28896  same = 0;
28897  break;
28898  }
28899  }
28900  if (!same) {
28901  char rtversion[5] = {'\0'};
28902  char message[200];
28903  for (i=0; i<4; ++i) {
28904  if (rt_from_call[i] == '.') {
28905  if (found_dot) break;
28906  found_dot = 1;
28907  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
28908  break;
28909  }
28910  rtversion[i] = rt_from_call[i];
28911  }
28912  PyOS_snprintf(message, sizeof(message),
28913  "compiletime version %s of module '%.100s' "
28914  "does not match runtime version %s",
28915  ctversion, __Pyx_MODULE_NAME, rtversion);
28916  return PyErr_WarnEx(NULL, message, 1);
28917  }
28918  return 0;
28919 }
28920 
28921 /* InitStrings */
28922  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28923  while (t->p) {
28924  #if PY_MAJOR_VERSION < 3
28925  if (t->is_unicode) {
28926  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28927  } else if (t->intern) {
28928  *t->p = PyString_InternFromString(t->s);
28929  } else {
28930  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28931  }
28932  #else
28933  if (t->is_unicode | t->is_str) {
28934  if (t->intern) {
28935  *t->p = PyUnicode_InternFromString(t->s);
28936  } else if (t->encoding) {
28937  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28938  } else {
28939  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28940  }
28941  } else {
28942  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28943  }
28944  #endif
28945  if (!*t->p)
28946  return -1;
28947  if (PyObject_Hash(*t->p) == -1)
28948  return -1;
28949  ++t;
28950  }
28951  return 0;
28952 }
28953 
28954 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28955  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28956 }
28957 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28958  Py_ssize_t ignore;
28959  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28960 }
28961 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28962 #if !CYTHON_PEP393_ENABLED
28963 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28964  char* defenc_c;
28965  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28966  if (!defenc) return NULL;
28967  defenc_c = PyBytes_AS_STRING(defenc);
28968 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28969  {
28970  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28971  char* c;
28972  for (c = defenc_c; c < end; c++) {
28973  if ((unsigned char) (*c) >= 128) {
28974  PyUnicode_AsASCIIString(o);
28975  return NULL;
28976  }
28977  }
28978  }
28979 #endif
28980  *length = PyBytes_GET_SIZE(defenc);
28981  return defenc_c;
28982 }
28983 #else
28984 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28985  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28986 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28987  if (likely(PyUnicode_IS_ASCII(o))) {
28988  *length = PyUnicode_GET_LENGTH(o);
28989  return PyUnicode_AsUTF8(o);
28990  } else {
28991  PyUnicode_AsASCIIString(o);
28992  return NULL;
28993  }
28994 #else
28995  return PyUnicode_AsUTF8AndSize(o, length);
28996 #endif
28997 }
28998 #endif
28999 #endif
29000 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29001 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29002  if (
29003 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29004  __Pyx_sys_getdefaultencoding_not_ascii &&
29005 #endif
29006  PyUnicode_Check(o)) {
29007  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29008  } else
29009 #endif
29010 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29011  if (PyByteArray_Check(o)) {
29012  *length = PyByteArray_GET_SIZE(o);
29013  return PyByteArray_AS_STRING(o);
29014  } else
29015 #endif
29016  {
29017  char* result;
29018  int r = PyBytes_AsStringAndSize(o, &result, length);
29019  if (unlikely(r < 0)) {
29020  return NULL;
29021  } else {
29022  return result;
29023  }
29024  }
29025 }
29026 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29027  int is_true = x == Py_True;
29028  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29029  else return PyObject_IsTrue(x);
29030 }
29031 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29032  int retval;
29033  if (unlikely(!x)) return -1;
29034  retval = __Pyx_PyObject_IsTrue(x);
29035  Py_DECREF(x);
29036  return retval;
29037 }
29038 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29039 #if PY_MAJOR_VERSION >= 3
29040  if (PyLong_Check(result)) {
29041  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29042  "__int__ returned non-int (type %.200s). "
29043  "The ability to return an instance of a strict subclass of int "
29044  "is deprecated, and may be removed in a future version of Python.",
29045  Py_TYPE(result)->tp_name)) {
29046  Py_DECREF(result);
29047  return NULL;
29048  }
29049  return result;
29050  }
29051 #endif
29052  PyErr_Format(PyExc_TypeError,
29053  "__%.4s__ returned non-%.4s (type %.200s)",
29054  type_name, type_name, Py_TYPE(result)->tp_name);
29055  Py_DECREF(result);
29056  return NULL;
29057 }
29058 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29059 #if CYTHON_USE_TYPE_SLOTS
29060  PyNumberMethods *m;
29061 #endif
29062  const char *name = NULL;
29063  PyObject *res = NULL;
29064 #if PY_MAJOR_VERSION < 3
29065  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29066 #else
29067  if (likely(PyLong_Check(x)))
29068 #endif
29069  return __Pyx_NewRef(x);
29070 #if CYTHON_USE_TYPE_SLOTS
29071  m = Py_TYPE(x)->tp_as_number;
29072  #if PY_MAJOR_VERSION < 3
29073  if (m && m->nb_int) {
29074  name = "int";
29075  res = m->nb_int(x);
29076  }
29077  else if (m && m->nb_long) {
29078  name = "long";
29079  res = m->nb_long(x);
29080  }
29081  #else
29082  if (likely(m && m->nb_int)) {
29083  name = "int";
29084  res = m->nb_int(x);
29085  }
29086  #endif
29087 #else
29088  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29089  res = PyNumber_Int(x);
29090  }
29091 #endif
29092  if (likely(res)) {
29093 #if PY_MAJOR_VERSION < 3
29094  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29095 #else
29096  if (unlikely(!PyLong_CheckExact(res))) {
29097 #endif
29098  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29099  }
29100  }
29101  else if (!PyErr_Occurred()) {
29102  PyErr_SetString(PyExc_TypeError,
29103  "an integer is required");
29104  }
29105  return res;
29106 }
29107 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29108  Py_ssize_t ival;
29109  PyObject *x;
29110 #if PY_MAJOR_VERSION < 3
29111  if (likely(PyInt_CheckExact(b))) {
29112  if (sizeof(Py_ssize_t) >= sizeof(long))
29113  return PyInt_AS_LONG(b);
29114  else
29115  return PyInt_AsSsize_t(b);
29116  }
29117 #endif
29118  if (likely(PyLong_CheckExact(b))) {
29119  #if CYTHON_USE_PYLONG_INTERNALS
29120  const digit* digits = ((PyLongObject*)b)->ob_digit;
29121  const Py_ssize_t size = Py_SIZE(b);
29122  if (likely(__Pyx_sst_abs(size) <= 1)) {
29123  ival = likely(size) ? digits[0] : 0;
29124  if (size == -1) ival = -ival;
29125  return ival;
29126  } else {
29127  switch (size) {
29128  case 2:
29129  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29130  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29131  }
29132  break;
29133  case -2:
29134  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29135  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29136  }
29137  break;
29138  case 3:
29139  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29140  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29141  }
29142  break;
29143  case -3:
29144  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29145  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29146  }
29147  break;
29148  case 4:
29149  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29150  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29151  }
29152  break;
29153  case -4:
29154  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29155  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29156  }
29157  break;
29158  }
29159  }
29160  #endif
29161  return PyLong_AsSsize_t(b);
29162  }
29163  x = PyNumber_Index(b);
29164  if (!x) return -1;
29165  ival = PyInt_AsSsize_t(x);
29166  Py_DECREF(x);
29167  return ival;
29168 }
29169 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29170  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
29171  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29172 #if PY_MAJOR_VERSION < 3
29173  } else if (likely(PyInt_CheckExact(o))) {
29174  return PyInt_AS_LONG(o);
29175 #endif
29176  } else {
29177  Py_ssize_t ival;
29178  PyObject *x;
29179  x = PyNumber_Index(o);
29180  if (!x) return -1;
29181  ival = PyInt_AsLong(x);
29182  Py_DECREF(x);
29183  return ival;
29184  }
29185 }
29186 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29187  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29188 }
29189 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29190  return PyInt_FromSize_t(ival);
29191 }
29192 
29193 
29194 #endif /* Py_PYTHON_H */
Base class for linear operators. This class serves as interface for all derived classes.